Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pazos committed May 25, 2024
1 parent 78ee12d commit 064b914
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions tools/update-metadata.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ local _ = require("gettext")

local updated_files = {}

-- we can't require util here, some C libraries might not be available
local function htmlEscape(text)
return text:gsub("[}{\">/<'&]", {
["&"] = "&amp;",
["<"] = "&lt;",
[">"] = "&gt;",
['"'] = "&quot;",
["'"] = "&#39;",
["/"] = "&#47;",
})
end

local function isFile(str)
local f = io.open(str, "r")
if f then
Expand Down Expand Up @@ -207,7 +219,7 @@ local function htmlDescription(lang)
local t = {}
_.changeLang(lang)
for i, v in ipairs (desc.paragraphs) do
table.insert(t, "<p>" .. util.htmlEscape(_(v)) .. "</p>")
table.insert(t, "<p>" .. htmlEscape(_(v)) .. "</p>")
end

table.insert(t, "<ul>")
Expand Down Expand Up @@ -347,7 +359,7 @@ local function genFastlane()
metadata_file = metadata_dir .. short
writeFile(short_translated, metadata_file)
end
if long_orig ~= long_translated then
if full_orig ~= full_translated then
metadata_file = metadata_dir .. full
writeFile(full_translated, metadata_file)
end
Expand Down

0 comments on commit 064b914

Please sign in to comment.