diff --git a/google-noto-fonts.spec b/google-noto-fonts.spec index e44467e..4a36128 100644 --- a/google-noto-fonts.spec +++ b/google-noto-fonts.spec @@ -573,6 +573,37 @@ local function wordwrap(text) return output end +-- A helper to close AppStream XML runs +local function closetag(oldtag, newtag) + if (oldtag == nil) then + return "" + else + local output = "]]>" + if (oldtag == "li") and (newtag ~= oldtag) then + output = output .. "" + end + return output + end +end + +-- A helper to open AppStream XML runs +local function opentag(oldtag, newtag) + if (newtag == nil) then + return "" + else + local output = "<" .. newtag .. ">" .. output + end + return output + end +end + +-- A helper to switch AppStream XML runs +local function switchtag(oldtag, newtag) + return closetag(oldtag, newtag) .. opentag(oldtag, newtag) +end + -- Reformat some text into something that can be included in an AppStream -- XML description local function txt2xml(text)