diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-01-29 16:15:09 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-01-29 16:15:09 +0100 |
commit | 452587cdeefbf6e3bf1eee91e4e976f1135b785f (patch) | |
tree | e52f05dfd327c3b31a1b0fb82545dbdec639d2e2 /tex/context/base/mkiv/strc-ini.lua | |
parent | 975f4f9f2d71d8021900955404f8b144ca6895f5 (diff) | |
download | context-452587cdeefbf6e3bf1eee91e4e976f1135b785f.tar.gz |
2016-01-28 22:37:00
Diffstat (limited to 'tex/context/base/mkiv/strc-ini.lua')
-rw-r--r-- | tex/context/base/mkiv/strc-ini.lua | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/tex/context/base/mkiv/strc-ini.lua b/tex/context/base/mkiv/strc-ini.lua index 7a6153096..dffbe3fcd 100644 --- a/tex/context/base/mkiv/strc-ini.lua +++ b/tex/context/base/mkiv/strc-ini.lua @@ -233,6 +233,13 @@ local tags = { -- -- local command = formatters["\\xmlprocessbuffer{%s}{%s}{}"](metadata.xmlroot or "main",tag) +local overload_catcodes = true + +directives.register("typesetters.processors.overloadcatcodes",function(v) + -- number | true | false | string + overload_catcodes = v +end) + local experiment = true function helpers.title(title,metadata) -- coding is xml is rather old and not that much needed now @@ -265,12 +272,7 @@ function helpers.title(title,metadata) -- coding is xml is rather old and not th ctx_xmlsetup(title,metadata.xmlsetup) else local catcodes = metadata.catcodes - if catcodes == notcatcodes or catcodes == xmlcatcodes then - if trace_processors then - report_processors("catcodetable %a, overloads %a, text %a",ctxcatcodes,catcodes,title) - end - context(title) -- nasty - else + if overload_catcodes == false then if trace_processors then report_processors("catcodetable %a, text %a",catcodes,title) end @@ -283,10 +285,30 @@ function helpers.title(title,metadata) -- coding is xml is rather old and not th ctx_pushcatcodes(catcodes) context(title) ctx_popcatcodes() + elseif overload_catcodes == true then + if catcodes == notcatcodes or catcodes == xmlcatcodes then + -- when was this needed + if trace_processors then + report_processors("catcodetable %a, overloads %a, text %a",ctxcatcodes,catcodes,title) + end + context(title) + else + ctx_pushcatcodes(catcodes) + context(title) + ctx_popcatcodes() + end + else + if trace_processors then + report_processors("catcodetable %a, overloads %a, text %a",catcodes,overload_catcodes,title) + end + ctx_pushcatcodes(overload_catcodes) + context(title) + ctx_popcatcodes() end end else - context(title) -- no catcode switch, was: texsprint(title) + -- no catcode switch, was: texsprint(title) + context(title) end end end |