diff options
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luaxml/luaxml-domobject.lua')
-rw-r--r-- | Master/texmf-dist/tex/luatex/luaxml/luaxml-domobject.lua | 7 |
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 |