diff options
Diffstat (limited to 'tex/context/base/back-exp.lua')
-rw-r--r-- | tex/context/base/back-exp.lua | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tex/context/base/back-exp.lua b/tex/context/base/back-exp.lua index 8c102c20a..f379878dd 100644 --- a/tex/context/base/back-exp.lua +++ b/tex/context/base/back-exp.lua @@ -187,6 +187,7 @@ local attribentities = { ["&"] = "&", [">"] = ">", ["<"] = "<", ['" local p_entity = lpeg.replacer(entities) -- was: entityremapper = utf.remapper(entities) local p_attribute = lpeg.replacer(attribentities) +local p_stripper = lpeg.patterns.stripper local alignmapping = { flushright = "right", @@ -604,6 +605,30 @@ do end +local function ignorebreaks(result,element,detail,n,fulltag,di) + local data = di.data + for i=1,#data do + local d = data[i] + if d.content == " " then + d.content = "" + end + end +end + +local function ignorespaces(result,element,detail,n,fulltag,di) + local data = di.data + for i=1,#data do + local d = data[i] + local c = d.content + if type(c) == "string" then + d.content = lpegmatch(p_stripper,c) + end + end +end + +extras.registerpages = ignorebreaks +extras.registerseparator = ignorespaces + do local highlight = { } |