summaryrefslogtreecommitdiff
path: root/tex/context/base/lxml-tex.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2011-10-12 11:40:13 +0300
committerMarius <mariausol@gmail.com>2011-10-12 11:40:13 +0300
commitc766ac76f88d4542235043790e8048c12b37d4ff (patch)
tree61e4e4fe4150eeb24e7bdb2fa5a95df1dd4d138f /tex/context/base/lxml-tex.lua
parentd67c88b277ff5d781397fb99ef9470f51b8eeced (diff)
downloadcontext-c766ac76f88d4542235043790e8048c12b37d4ff.tar.gz
beta 2011.10.12 10:14
Diffstat (limited to 'tex/context/base/lxml-tex.lua')
-rw-r--r--tex/context/base/lxml-tex.lua12
1 files changed, 9 insertions, 3 deletions
diff --git a/tex/context/base/lxml-tex.lua b/tex/context/base/lxml-tex.lua
index 0dd85a808..e77736b43 100644
--- a/tex/context/base/lxml-tex.lua
+++ b/tex/context/base/lxml-tex.lua
@@ -966,14 +966,20 @@ end
local function command(collected,cmd,otherwise)
local n = collected and #collected
if n and n > 0 then
- for c=1,n do
+ local wildcard = find(cmd,"%*")
+ for c=1,n do -- maybe optimize for n=1
local e = collected[c]
local ix = e.ix
+ local name = e.name
if not ix then
- lxml.addindex(e.name,false,true)
+ lxml.addindex(name,false,true)
ix = e.ix
end
- contextsprint(ctxcatcodes,"\\xmlw{",cmd,"}{",e.name,"::",ix,"}")
+ if wildcard then
+ contextsprint(ctxcatcodes,"\\xmlw{",(gsub(cmd,"%*",e.tg)),"}{",name,"::",ix,"}")
+ else
+ contextsprint(ctxcatcodes,"\\xmlw{",cmd,"}{",name,"::",ix,"}")
+ end
end
elseif otherwise then
contextsprint(ctxcatcodes,"\\xmlw{",otherwise,"}{#1}")