diff options
author | Hans Hagen <pragma@wxs.nl> | 2018-11-29 20:53:37 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2018-11-29 20:53:37 +0100 |
commit | 9bd28a3039a458b054459fe1ef80161b107b798f (patch) | |
tree | c15bf6aedc4313de999a97bf92dc63b16ca60794 /tex/context/base/mkiv/lpdf-tag.lua | |
parent | 744095aa4676553437db0d71c281a74557a3222f (diff) | |
download | context-9bd28a3039a458b054459fe1ef80161b107b798f.tar.gz |
2018-11-29 19:54:00
Diffstat (limited to 'tex/context/base/mkiv/lpdf-tag.lua')
-rw-r--r-- | tex/context/base/mkiv/lpdf-tag.lua | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/tex/context/base/mkiv/lpdf-tag.lua b/tex/context/base/mkiv/lpdf-tag.lua index d57da4ccd..70a97c9d0 100644 --- a/tex/context/base/mkiv/lpdf-tag.lua +++ b/tex/context/base/mkiv/lpdf-tag.lua @@ -75,9 +75,9 @@ local structure_kids -- delayed local structure_ref -- delayed local parent_ref -- delayed local root -- delayed +local names -- delayed local tree = { } local elements = { } -local names = false -- delayed local structurestags = structures.tags local taglist = structurestags.taglist @@ -111,7 +111,7 @@ local usedmapping = { } -- end local function finishstructure() - if root and names and #structure_kids > 0 then + if root and #structure_kids > 0 then local nums, n = pdfarray(), 0 for i=1,#tree do n = n + 1 ; nums[n] = i - 1 @@ -257,14 +257,10 @@ local function makeelement(fulltag,parent) AF = af, } local s = pdfreference(pdfflushobject(d)) - if id then - if names then - local size = #names - names[size+1] = id - names[size+2] = s - else - names= { id, s } - end + if id and names then + local size = #names + names[size+1] = id + names[size+2] = s end local kids = parent.kids kids[#kids+1] = s @@ -338,6 +334,7 @@ function nodeinjections.addtags(head) structure_ref = pdfreserveobject() parent_ref = pdfreserveobject() root = { pref = pdfreference(structure_ref), kids = structure_kids } + names = pdfarray() end local function collectranges(head,list) |