Skip to content

Commit 0e8d9d6

Browse files
committed
HTML-escape institution names in CrossRef XML
1 parent a3027dc commit 0e8d9d6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

data/filters/prepare-affiliations.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ local function prepare_affiliations (meta)
1010
for i, affiliation_index in ipairs(author.affiliation) do
1111
affiliation_index = tonumber(pandoc.utils.stringify(affiliation_index))
1212
local affiliation = meta.affiliations[affiliation_index]
13+
local function html_escape(str)
14+
local doc = pandoc.Pandoc{pandoc.Str(str)}
15+
return pandoc.write(doc, 'html')
16+
end
1317
xml = xml.. "\n <institution><institution_name>"
1418
for _, v in ipairs(affiliation.name) do
1519
if v.text then
16-
xml = xml .. v.text
20+
xml = xml .. html_escape(v.text)
1721
else
1822
xml = xml .. " "
1923
end

0 commit comments

Comments
 (0)