diff options
author | Hans Hagen <pragma@wxs.nl> | 2021-02-05 18:08:41 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2021-02-05 18:08:41 +0100 |
commit | 5a7dd5d18ced4a73b05467f208d4c4b0d1afebc0 (patch) | |
tree | 7138a651a94fb013e584b080c50c4681321617cc /tex/context/base/mkiv/strc-reg.lua | |
parent | ab4fc27d8b1541b491621e07ab1f40f30aaf50ae (diff) | |
download | context-5a7dd5d18ced4a73b05467f208d4c4b0d1afebc0.tar.gz |
2021-02-05 17:44:00
Diffstat (limited to 'tex/context/base/mkiv/strc-reg.lua')
-rw-r--r-- | tex/context/base/mkiv/strc-reg.lua | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/tex/context/base/mkiv/strc-reg.lua b/tex/context/base/mkiv/strc-reg.lua index 6873f89eb..6e26f6f37 100644 --- a/tex/context/base/mkiv/strc-reg.lua +++ b/tex/context/base/mkiv/strc-reg.lua @@ -460,6 +460,7 @@ local function preprocessentries(rawdata) local processors = rawdata.processors local et = entries.entries local kt = entries.keys + local pt = entries.processors local entryproc = processors and processors.entry local pageproc = processors and processors.page local coding = rawdata.metadata.coding @@ -483,16 +484,20 @@ local function preprocessentries(rawdata) end kt = lpegmatch(coding == "xml" and entrysplitter_xml or entrysplitter_tex,k) end + if not pt then + pt = { } + end -- entries = { } local ok = false for k=#et,1,-1 do local etk = et[k] local ktk = kt[k] + local ptk = pt[k] if not ok and etk == "" then entries[k] = nil else - entries[k] = { etk or "", ktk ~= "" and ktk or nil } + entries[k] = { etk or "", ktk ~= "" and ktk or false, ptk ~= "" and ptk or false } ok = true end end @@ -677,31 +682,33 @@ implement { { "catcodes", "integer" }, { "own" }, { "xmlroot" }, - { "xmlsetup" } + { "xmlsetup" }, } }, { "entries", { { "entries", "list" }, { "keys", "list" }, + { "processors", "list" }, { "entry" }, - { "key" } + { "key" }, + { "processor" }, } }, { "references", { { "internal", "integer" }, { "section", "integer" }, { "view" }, - { "label" } + { "label" }, } }, { "seeword", { - { "text" } + { "text" }, } }, { "processors", { { "entry" }, { "key" }, - { "page" } + { "page" }, } }, { "userdata" }, @@ -1258,6 +1265,7 @@ function registers.flush(data,options,prefixspec,pagespec) while d < #data do d = d + 1 local entry = data[d] +-- inspect(entry) local metadata = entry.metadata local kind = metadata.kind local list = entry.list @@ -1266,8 +1274,9 @@ function registers.flush(data,options,prefixspec,pagespec) e[i] = false end for i=1,maxlevel do + local li = list[i] if list[i] then - e[i] = list[i][1] + e[i] = li[1] end if e[i] == done[i] then -- skip @@ -1309,7 +1318,7 @@ function registers.flush(data,options,prefixspec,pagespec) local processors = entry.processors local internal = references.internal or 0 local seeparent = references.seeparent or "" - local processor = processors and processors[1] or "" + local processor = (li and li[3]) or (processors and processors[1]) or "" -- so, we need to keep e as is (local), or we need local title = e[i] ... which might be -- more of a problem ctx_startregisterentry(0) -- will become a counter |