summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/lpdf-tag.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2019-12-12 02:01:50 +0100
committerContext Git Mirror Bot <phg@phi-gamma.net>2019-12-12 02:01:50 +0100
commite75317d1924dd10388f154df7412a0ab201e455e (patch)
tree2fc6cfd0391d3997cdaf1f8120cfa1a55bc30d10 /tex/context/base/mkiv/lpdf-tag.lua
parentf74c4055713ab52a11d12435eb04040ec6553129 (diff)
downloadcontext-e75317d1924dd10388f154df7412a0ab201e455e.tar.gz
2019-12-12 01:07:00
Diffstat (limited to 'tex/context/base/mkiv/lpdf-tag.lua')
-rw-r--r--tex/context/base/mkiv/lpdf-tag.lua40
1 files changed, 32 insertions, 8 deletions
diff --git a/tex/context/base/mkiv/lpdf-tag.lua b/tex/context/base/mkiv/lpdf-tag.lua
index d99e09243..61a6999c1 100644
--- a/tex/context/base/mkiv/lpdf-tag.lua
+++ b/tex/context/base/mkiv/lpdf-tag.lua
@@ -26,6 +26,7 @@ local nodeinjections = backends.pdf.nodeinjections
local codeinjections = backends.pdf.codeinjections
local enableaction = nodes.tasks.enableaction
+local disableaction = nodes.tasks.disableaction
local pdfdictionary = lpdf.dictionary
local pdfarray = lpdf.array
@@ -695,13 +696,36 @@ end
-- this belongs elsewhere (export is not pdf related)
-function codeinjections.enabletags(tg,lb)
- structures.tags.handler = nodeinjections.addtags
- enableaction("shipouts","structures.tags.handler")
- enableaction("shipouts","nodes.handlers.accessibility")
- enableaction("math","noads.handlers.tags")
- -- maybe also textblock
- if trace_tags then
- report_tags("enabling structure tags")
+local permitted = true
+local enabled = false
+
+function codeinjections.settaggingsupport(option)
+ if option == false then
+ if enabled then
+ disableaction("shipouts","structures.tags.handler")
+ disableaction("shipouts","nodes.handlers.accessibility") -- maybe not this one
+ disableaction("math","noads.handlers.tags")
+ enabled = false
+ end
+ if permitted then
+ if trace_tags then
+ report_tags("blocking structure tags")
+ end
+ permitted = false
+ end
+ end
+end
+
+function codeinjections.enabletags()
+ if permitted and not enabled then
+ structures.tags.handler = nodeinjections.addtags
+ enableaction("shipouts","structures.tags.handler")
+ enableaction("shipouts","nodes.handlers.accessibility")
+ enableaction("math","noads.handlers.tags")
+ -- maybe also textblock
+ if trace_tags then
+ report_tags("enabling structure tags")
+ end
+ enabled = true
end
end