summaryrefslogtreecommitdiff
path: root/tex/context/base/lxml-sor.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2010-01-04 19:48:00 +0100
committerHans Hagen <pragma@wxs.nl>2010-01-04 19:48:00 +0100
commit20c4037f15e32fe45d05807514f75249d7d416e8 (patch)
tree95c8263be9c48adac48d89eabf6a24a2b6d883cc /tex/context/base/lxml-sor.lua
parent19719774e5f0a521cb21bc09f26a8f82f4dab56c (diff)
downloadcontext-20c4037f15e32fe45d05807514f75249d7d416e8.tar.gz
beta 2010.01.04 19:48
Diffstat (limited to 'tex/context/base/lxml-sor.lua')
-rw-r--r--tex/context/base/lxml-sor.lua26
1 files changed, 23 insertions, 3 deletions
diff --git a/tex/context/base/lxml-sor.lua b/tex/context/base/lxml-sor.lua
index daeb9ec7b..7aebef79d 100644
--- a/tex/context/base/lxml-sor.lua
+++ b/tex/context/base/lxml-sor.lua
@@ -60,12 +60,32 @@ function lxml.sorters.show(name)
local entries = list and list.entries
local NC, NR, bold = context.NC, context.NR, context.bold -- somehow bold is not working
if entries then
- context.starttabulate { "|Tr|Tr|Tl|" }
- NC() bold("n") NC() bold("id") NC() bold("entry") NR() context.HL()
+ local maxn = 1
+ for i=1,#entries do
+ if #entries[i][2] > maxn then maxn = #entries[i][2] end
+ end
+ context.starttabulate { "|Tr|Tr|" .. string.rep("Tlp|",maxn) }
+ NC() bold("n")
+ NC() bold("id")
+ if maxn > 1 then
+ for i=1,maxn do
+ NC() bold("entry " .. i)
+ end
+ else
+ NC() bold("entry")
+ end
+ NC() NR()
+ context.HL()
for i=1,#entries do
local entry = entries[i]
local document, node = lxml.splitid(entry[1])
- NC() context(i) NC() context(node) NC() context(concat(entry[2]," ")) NR()
+ NC() context(i)
+ NC() context(node)
+ local e = entry[2]
+ for i=1,#e do
+ NC() context.detokenize(e[i])
+ end
+ NC() NR()
end
context.stoptabulate()
end