diff options
Diffstat (limited to 'tex/context/base/x-mathml.lua')
-rw-r--r-- | tex/context/base/x-mathml.lua | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/tex/context/base/x-mathml.lua b/tex/context/base/x-mathml.lua index cc7238f94..430122786 100644 --- a/tex/context/base/x-mathml.lua +++ b/tex/context/base/x-mathml.lua @@ -106,6 +106,7 @@ local i_replacements = { ["identity"] = "\\mathopnolimits{id}", ["image"] = "\\mathopnolimits{image}", ["lcm"] = "\\mathopnolimits{lcm}", + ["lim"] = "\\mathopnolimits{lim}", ["max"] = "\\mathopnolimits{max}", ["median"] = "\\mathopnolimits{median}", ["min"] = "\\mathopnolimits{min}", @@ -486,12 +487,32 @@ function mathml.mo(id) context(simpleoperatorremapper(rep)) end +-- function mathml.mi(id) +-- local e = getid(id) +-- local str = e.dt +-- if type(str) == "string" then -- we need a helper for this in the xml namespace ... xml.type(e) +-- -- local str = xmlcontent(e) or "" +-- local str = gsub(str,"&.-;","") -- needed? +-- local rep = i_replacements[str] +-- if not rep then +-- rep = gsub(str,".",i_replacements) +-- end +-- context(rep) +-- -- context.mi(rep) +-- else +-- context.xmlflush(id) -- xmlsprint or so +-- end +-- end + function mathml.mi(id) + -- we need to strip comments etc .. todo when reading in tree local e = getid(id) local str = e.dt - if type(str) == "string" then -- we need a helper for this in the xml namespace ... xml.type(e) - -- local str = xmlcontent(e) or "" - local str = gsub(str,"&.-;","") -- needed? + local n = #str + if n == 0 then + -- nothing to do + elseif n == 1 then + local str = gsub(str[1],"&.-;","") -- bah local rep = i_replacements[str] if not rep then rep = gsub(str,".",i_replacements) |