summaryrefslogtreecommitdiff
path: root/support/make4ht/formats/make4ht-odt.lua
diff options
context:
space:
mode:
Diffstat (limited to 'support/make4ht/formats/make4ht-odt.lua')
-rw-r--r--support/make4ht/formats/make4ht-odt.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/support/make4ht/formats/make4ht-odt.lua b/support/make4ht/formats/make4ht-odt.lua
index 30fdc0744d..4d5d768ee7 100644
--- a/support/make4ht/formats/make4ht-odt.lua
+++ b/support/make4ht/formats/make4ht-odt.lua
@@ -128,6 +128,13 @@ local function exec_group(groups, name, fn)
end
end
+-- remove <?xtpipes XML instructions, because they cause issues in some ODT processing
+-- applications
+local function remove_xtpipes(text)
+ -- remove <?x
+ return text:gsub("%<%?xtpipes.-%?%>", "")
+end
+
function M.modify_build(make)
local executed = false
-- execute xtpipes from the build file, instead of t4ht. this fixes issues with wrong paths
@@ -142,7 +149,7 @@ function M.modify_build(make)
-- execute it before xtpipes, because we don't want xtpipes to mess with t4htlink elements
move_matches(make)
-- convert XML entities for Unicode characters produced by Xtpipes to characters
- local fixentities = filter {"entities-to-unicode"}
+ local fixentities = filter {"entities-to-unicode", remove_xtpipes}
make:match("4oo", fixentities)
make:match("4om", fixentities)