summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luaxml/luaxml-domobject.lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-07-12 20:19:16 +0000
committerKarl Berry <karl@freefriends.org>2018-07-12 20:19:16 +0000
commit305fdb2acd4efc585b2004a9d5a1cd7d1a0741c0 (patch)
tree4db549980350fb3bff688b3642355292f2c7265e /Master/texmf-dist/tex/luatex/luaxml/luaxml-domobject.lua
parent6845f9790164770d1f7b55b5ab2a2fcc81198a00 (diff)
luaxml (12jul18)
git-svn-id: svn://tug.org/texlive/trunk@48190 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.lua13
1 files changed, 10 insertions, 3 deletions
diff --git a/Master/texmf-dist/tex/luatex/luaxml/luaxml-domobject.lua b/Master/texmf-dist/tex/luatex/luaxml/luaxml-domobject.lua
index 21f67a6f4ed..ac4404b393a 100644
--- a/Master/texmf-dist/tex/luatex/luaxml/luaxml-domobject.lua
+++ b/Master/texmf-dist/tex/luatex/luaxml/luaxml-domobject.lua
@@ -37,7 +37,9 @@ local actions = {
COMMENT = {start = "<!-- ", text = "%s", stop = " -->"},
ELEMENT = {start = "<%s%s>", stop = "</%s>", void = "<%s%s />"},
DECL = {start = "<?%s %s?>"},
- DTD = {start = "<!DOCTYPE ", text = "%s" , stop=">"}
+ DTD = {start = "<!DOCTYPE ", text = "%s" , stop=">"},
+ CDATA = {start = "<![CDATA[", text = "%s", stop ="]]>"}
+
}
--- It serializes the DOM object back to the XML.
@@ -370,11 +372,16 @@ local parse = function(
--- Add child node to the current node
function DOM_Object:add_child_node(
- child --- element to be inserted as a current node child
+ child, --- element to be inserted as a current node child
+ position --- [optional] position at which should the node be inserted
)
local parent = self
child._parent = parent
- table.insert(parent._children, child)
+ if position then
+ table.insert(parent._children, position, child)
+ else
+ table.insert(parent._children, child)
+ end
end