From 0c75a2acf592eb4360685375904440f5e6b8125a Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Tue, 12 Nov 2019 19:54:50 +0100 Subject: 2019-11-12 18:53:00 --- tex/context/base/mkiv/node-fin.lua | 97 ++++---------------------------------- 1 file changed, 10 insertions(+), 87 deletions(-) (limited to 'tex/context/base/mkiv/node-fin.lua') diff --git a/tex/context/base/mkiv/node-fin.lua b/tex/context/base/mkiv/node-fin.lua index 5f2940f45..b328f925d 100644 --- a/tex/context/base/mkiv/node-fin.lua +++ b/tex/context/base/mkiv/node-fin.lua @@ -557,15 +557,21 @@ local function stacker(attribute,head,default) -- no triggering, no inheritance, if a and attrib ~= a and nslistwise[a] then -- viewerlayer head = insert_node_before(head,current,copy_node(nsdata[a])) list = stacker(attribute,content,a) + if list ~= content then + setlist(current,list) + end head, current = insert_node_after(head,current,copy_node(nsnone)) else - list = stacker(attribute,content,attrib) + list = stacker(attribute,content,a) + if list ~= content then + setlist(current,list) + end end else list = stacker(attribute,content,default) - end - if list ~= content then - setlist(current,list) + if list ~= content then + setlist(current,list) + end end end elseif id == rule_code then @@ -618,89 +624,6 @@ local function stacker(attribute,head,default) -- no triggering, no inheritance, return head end --- local nextid = nodes.nuts.traversers.id --- --- local function stacker(attribute,head,default) -- no triggering, no inheritance, but list-wise --- --- -- nsbegin() --- local stacked = false --- --- local current = head --- local previous = head --- local attrib = default or unsetvalue --- local check = false --- local leader = false --- --- local id = getid(current) --- while current do --- if id == glyph_code then --- check = true --- elseif id == glue_code then --- leader = getleader(current) --- if leader then --- check = true --- end --- elseif id == hlist_code or id == vlist_code then --- local content = getlist(current) --- if content then --- local list --- if nslistwise then --- local a = getattr(current,attribute) --- if a and attrib ~= a and nslistwise[a] then -- viewerlayer --- head = insert_node_before(head,current,copy_node(nsdata[a])) --- list = stacker(attribute,content,a) --- head, current = insert_node_after(head,current,copy_node(nsnone)) --- else --- list = stacker(attribute,content,attrib) --- end --- else --- list = stacker(attribute,content,default) --- end --- if list ~= content then --- setlist(current,list) --- end --- end --- elseif id == rule_code then --- check = getwidth(current) ~= 0 --- end --- --- if check then --- local a = getattr(current,attribute) or unsetvalue --- if a ~= attrib then --- if not stacked then --- stacked = true --- nsbegin() --- end --- local n = nsstep(a) --- if n then --- head = insert_node_before(head,current,n) -- a --- end --- attrib = a --- if leader then --- -- tricky as a leader has to be a list so we cannot inject before --- local list = stacker(attribute,leader,attrib) --- leader = false --- end --- end --- check = false --- end --- --- previous = current --- --- current, id = nextid(current,current) --- end --- --- if stacked then --- local n = nsend() --- while n do --- head = insert_node_after(head,previous,n) --- n = nsend() --- end --- end --- --- return head --- end - states.stacker = function(namespace,attribute,head,default) local head = stacker(attribute,head,default) nsreset() -- cgit v1.2.3