summaryrefslogtreecommitdiff
path: root/support/make4ht/filters
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2024-02-24 03:01:46 +0000
committerNorbert Preining <norbert@preining.info>2024-02-24 03:01:46 +0000
commitf325bd88d1d4db13f51277bc59c8ff8814e937bc (patch)
treee39af6619c91d812dd93cb57d25149da5a84d801 /support/make4ht/filters
parente7a321bba289c40f39563c19bbeac355f7c0eeeb (diff)
CTAN sync 202402240301
Diffstat (limited to 'support/make4ht/filters')
-rw-r--r--support/make4ht/filters/make4ht-domfilter.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/support/make4ht/filters/make4ht-domfilter.lua b/support/make4ht/filters/make4ht-domfilter.lua
index f6df769d60..68dd5a488c 100644
--- a/support/make4ht/filters/make4ht-domfilter.lua
+++ b/support/make4ht/filters/make4ht-domfilter.lua
@@ -37,10 +37,13 @@ local function filter(filters, name)
end
local input = filter_lib.load_input_file(filename)
if not input then return nil, "Cannot load the input file" end
+ -- in pure XML, we need to ignore void_elements provided by LuaXML, because these can exist only in HTML
+ local no_void_elements = {docbook = {}, jats = {}, odt = {}, tei = {} }
+ local void_elements = no_void_elements[parameters.output_format]
-- we need to use pcall, because XML error would break the whole build process
-- domobject will be error object if DOM parsing failed
local status, domobject = pcall(function()
- return dom.parse(input)
+ return dom.parse(input, void_elements)
end)
if not status then
log:warning("DOM parsing of " .. filename .. " failed:")