summaryrefslogtreecommitdiff
path: root/tex/context/base/node-tra.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/node-tra.lua')
-rw-r--r--tex/context/base/node-tra.lua20
1 files changed, 17 insertions, 3 deletions
diff --git a/tex/context/base/node-tra.lua b/tex/context/base/node-tra.lua
index 706b2fc10..61bd82ddc 100644
--- a/tex/context/base/node-tra.lua
+++ b/tex/context/base/node-tra.lua
@@ -541,15 +541,27 @@ end
nodes.showsimplelist = function(h,depth) showsimplelist(h,depth,0) end
-function nodes.listtoutf(h,joiner)
- local joiner = (joiner ==true and utfchar(0x200C)) or joiner -- zwnj
+local function listtoutf(h,joiner,textonly)
+ local joiner = (joiner == true and utfchar(0x200C)) or joiner -- zwnj
local w = { }
while h do
- if h.id == glyph_code then -- always true
+ local id = h.id
+ if id == glyph_code then -- always true
w[#w+1] = utfchar(h.char)
if joiner then
w[#w+1] = joiner
end
+ elseif id == disc_code then
+ local pre, rep, pos = h.pre, h.replace, h.post
+ w[#w+1] = format("[%s|%s|%s]",
+ pre and listtoutf(pre,joiner,textonly) or "",
+ rep and listtoutf(rep,joiner,textonly) or "",
+ mid and listtoutf(mid,joiner,textonly) or ""
+ )
+ elseif textonly then
+ if id == glue_code and h.width > 0 then
+ w[#w+1] = " "
+ end
else
w[#w+1] = "[-]"
end
@@ -558,6 +570,8 @@ function nodes.listtoutf(h,joiner)
return concat(w)
end
+nodes.listtoutf = listtoutf
+
local what = { [0] = "unknown", "line", "box", "indent", "row", "cell" }
local function showboxes(n,symbol,depth)