summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luaxml/luaxml-domobject.lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-07-20 21:20:09 +0000
committerKarl Berry <karl@freefriends.org>2020-07-20 21:20:09 +0000
commitb8018c0ac15e4ff48acef03c88dd51ba052d2123 (patch)
tree6e1914dd2306529b25bf3de3138ca2b20b81a0f1 /Master/texmf-dist/tex/luatex/luaxml/luaxml-domobject.lua
parent768f46b59939981d4528d9b176e19010e32d7b70 (diff)
luaxml (20jul20)
git-svn-id: svn://tug.org/texlive/trunk@55891 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luaxml/luaxml-domobject.lua')
-rw-r--r--Master/texmf-dist/tex/luatex/luaxml/luaxml-domobject.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/Master/texmf-dist/tex/luatex/luaxml/luaxml-domobject.lua b/Master/texmf-dist/tex/luatex/luaxml/luaxml-domobject.lua
index 413947b5d4c..6d299d41575 100644
--- a/Master/texmf-dist/tex/luatex/luaxml/luaxml-domobject.lua
+++ b/Master/texmf-dist/tex/luatex/luaxml/luaxml-domobject.lua
@@ -115,7 +115,12 @@ local function serialize_dom(parser, current,level, output)
attributes["_text"] = nil
elseif xtype == "DECL" and name =="xml" then
-- the xml declaration attributes must be in a correct order
- insert("<?xml version='%s' encoding='%s' ?>", attributes.version, attributes.encoding)
+ local encoding = attributes.encoding or "utf-8"
+ insert("<?xml version='%s' encoding='%s' ?>", attributes.version, encoding)
+ return output
+ elseif xtype == "CDATA" then
+ -- return content unescaped
+ insert(string.format("<![CDATA[%s]]>", text_content))
return output
end