diff options
author | Hans Hagen <pragma@wxs.nl> | 2018-05-12 01:19:03 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2018-05-12 01:19:03 +0200 |
commit | 77e216e323271fb85d508b7206b13c980540b74b (patch) | |
tree | 5b4053c2bbe5190e28c0dce89653c7b13aea0642 /tex/context/base/mkiv/lpdf-tag.lua | |
parent | d817aef76ab8b606c02bd0636661b634b43a68a6 (diff) | |
download | context-77e216e323271fb85d508b7206b13c980540b74b.tar.gz |
2018-05-12 00:16:00
Diffstat (limited to 'tex/context/base/mkiv/lpdf-tag.lua')
-rw-r--r-- | tex/context/base/mkiv/lpdf-tag.lua | 39 |
1 files changed, 17 insertions, 22 deletions
diff --git a/tex/context/base/mkiv/lpdf-tag.lua b/tex/context/base/mkiv/lpdf-tag.lua index dc7d038fe..b3d117c4b 100644 --- a/tex/context/base/mkiv/lpdf-tag.lua +++ b/tex/context/base/mkiv/lpdf-tag.lua @@ -51,8 +51,6 @@ local a_tagged = attributes.private('tagged') local a_image = attributes.private('image') local nuts = nodes.nuts -local tonut = nuts.tonut -local tonode = nuts.tonode local nodepool = nuts.pool local pdfpageliteral = nodepool.pdfpageliteral @@ -68,9 +66,10 @@ local setlink = nuts.setlink local setlist = nuts.setlist local copy_node = nuts.copy -local traverse_nodes = nuts.traverse local tosequence = nuts.tosequence +local nextnode = nuts.traversers.node + local structure_stack = { } local structure_kids = pdfarray() local structure_ref = pdfreserveobject() @@ -324,10 +323,9 @@ function nodeinjections.addtags(head) local last = nil local ranges = { } local range = nil - local head = tonut(head) local function collectranges(head,list) - for n, id in traverse_nodes(head) do + for n, id in nextnode, head do if id == glyph_code then -- maybe also disc local at = getattr(n,a_tagged) @@ -441,17 +439,17 @@ function nodeinjections.addtags(head) setlink(stop,literal) end --- if literal then --- if list and getlist(list) == start then --- setlink(literal,start) --- setlist(list,literal) --- else --- setlink(getprev(start),literal,start) --- end --- -- use insert instead: --- local literal = copy_node(EMCliteral) --- setlink(stop,literal,getnext(stop)) --- end + -- if literal then + -- if list and getlist(list) == start then + -- setlink(literal,start) + -- setlist(list,literal) + -- else + -- setlink(getprev(start),literal,start) + -- end + -- -- use insert instead: + -- local literal = copy_node(EMCliteral) + -- setlink(stop,literal,getnext(stop)) + -- end top = taglist noftop = noftags @@ -459,8 +457,7 @@ function nodeinjections.addtags(head) finishpage() - head = tonode(head) - return head, true + return head end @@ -471,7 +468,7 @@ end -- local last, ranges, range = nil, { }, nil -- -- local function collectranges(head,list) --- for n, id in traverse_nodes(head) do +-- for n, id in nextnode, head do -- if id == glyph_code then -- local at = getattr(n,a_tagged) -- if not at then @@ -503,7 +500,6 @@ end -- -- initializepage() -- --- head = tonut(head) -- collectranges(head) -- -- if trace_tags then @@ -610,8 +606,7 @@ end -- -- finishpage() -- --- head = tonode(head) --- return head, true +-- return head -- -- end |