summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/lxml-tex.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkiv/lxml-tex.lua')
-rw-r--r--tex/context/base/mkiv/lxml-tex.lua13
1 files changed, 4 insertions, 9 deletions
diff --git a/tex/context/base/mkiv/lxml-tex.lua b/tex/context/base/mkiv/lxml-tex.lua
index c9675d435..fc86b9460 100644
--- a/tex/context/base/mkiv/lxml-tex.lua
+++ b/tex/context/base/mkiv/lxml-tex.lua
@@ -45,6 +45,7 @@ local xmltext = xml.text
local xmltostring = xml.tostring
local xmlapplylpath = xml.applylpath
local xmlunspecialized = xml.unspecialized
+local xmldespecialized = xml.despecialized -- nicer in expanded xml
local xmlprivatetoken = xml.privatetoken
local xmlstripelement = xml.stripelement
local xmlinclusion = xml.inclusion
@@ -53,6 +54,7 @@ local xmlbadinclusions = xml.badinclusions
local xmlcontent = xml.content
local xmllastmatch = xml.lastmatch
+
directives.enable("xml.path.keeplastmatch")
local variables = interfaces and interfaces.variables or { }
@@ -308,14 +310,6 @@ function lxml.stopraw()
forceraw = false
end
-function lxml.startraw()
- forceraw = true
-end
-
-function lxml.stopraw()
- forceraw = false
-end
-
function lxml.rawroot()
return rawroot
end
@@ -911,7 +905,8 @@ local function sprint(root) -- check rawroot usage
if forceraw then
rawroot = root
-- contextsprint(ctxcatcodes,xmltostring(root)) -- goes wrong with % etc
- root = xmlunspecialized(xmltostring(root))
+ -- root = xmlunspecialized(xmltostring(root)) -- we loose < > &
+ root = xmldespecialized(xmltostring(root))
lpegmatch(xmltextcapture,root) -- goes to toc
else
xmlserialize(root,xmltexhandler)