diff options
Diffstat (limited to 'tex/context/base/lxml-tex.lua')
-rw-r--r-- | tex/context/base/lxml-tex.lua | 6 |
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,"}") |