diff options
author | Karl Berry <karl@freefriends.org> | 2021-09-14 20:25:48 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-09-14 20:25:48 +0000 |
commit | b09300e44dd6326ce89c11da7577b055e542a7b0 (patch) | |
tree | 5adf2aedf5cc45fb509a461271160aee660eee04 /Master/texmf-dist/tex/luatex/luaxml/luaxml-domobject.lua | |
parent | 1f21169c727289a07ebcdb4a049efc6457259558 (diff) |
luaxml (14sep21)
git-svn-id: svn://tug.org/texlive/trunk@60511 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.lua | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/luatex/luaxml/luaxml-domobject.lua b/Master/texmf-dist/tex/luatex/luaxml/luaxml-domobject.lua index 7829c13b1e7..a5c0d29fee2 100644 --- a/Master/texmf-dist/tex/luatex/luaxml/luaxml-domobject.lua +++ b/Master/texmf-dist/tex/luatex/luaxml/luaxml-domobject.lua @@ -392,6 +392,17 @@ local parse = function( return false, msg end + -- restore correct links to parent elements + local function fix_parents(el) + for k,v in ipairs(el._children or {}) do + if v:is_element() then + v._parent = el + fix_parents(v) + end + end + end + + --- Add child node to the current node function DOM_Object:add_child_node( child, --- element to be inserted as a current node child @@ -399,6 +410,7 @@ local parse = function( ) local parent = self child._parent = parent + fix_parents(child) if position then table.insert(parent._children, position, child) else |