summaryrefslogtreecommitdiff
path: root/tex/context/base/lxml-tex.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2014-05-16 20:08:00 +0200
committerHans Hagen <pragma@wxs.nl>2014-05-16 20:08:00 +0200
commitdcafc5c897cc956f197a54f516472954036af7f9 (patch)
treec54e512e741b947d8f3a13e91b76402484c55ef1 /tex/context/base/lxml-tex.lua
parentc3675f9b2c0dd9c6ae6b911593f5331dba5992a5 (diff)
downloadcontext-dcafc5c897cc956f197a54f516472954036af7f9.tar.gz
beta 2014.05.16 20:08
Diffstat (limited to 'tex/context/base/lxml-tex.lua')
-rw-r--r--tex/context/base/lxml-tex.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/tex/context/base/lxml-tex.lua b/tex/context/base/lxml-tex.lua
index adeee20c3..0c58a47cc 100644
--- a/tex/context/base/lxml-tex.lua
+++ b/tex/context/base/lxml-tex.lua
@@ -354,7 +354,7 @@ end
function lxml.checkindex(name)
local root = getid(name)
- return (root and root.index) or 0
+ return root and root.index or 0
end
function lxml.withindex(name,n,command) -- will change as name is always there now
@@ -1185,7 +1185,9 @@ local function command(collected,cmd,otherwise)
lxml.addindex(name,false,true)
ix = e.ix
end
- if wildcard then
+ if not ix then
+ report_lxml("no valid node index for element %a in command %s",name,cmd)
+ elseif wildcard then
contextsprint(ctxcatcodes,"\\xmlw{",(gsub(cmd,"%*",e.tg)),"}{",name,"::",ix,"}")
else
contextsprint(ctxcatcodes,"\\xmlw{",cmd,"}{",name,"::",ix,"}")