blob: 9b3e7f3f74dbd10a8f701a25d92391a8e0dd4777 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
local M = {}
local filter = require "make4ht-filter"
local process = filter {"cleanspan-nat", "fixligatures", "hruletohr", "entities", "fix-links"}
-- filters support only html formats
function M.test(format)
if format == "odt" then return false end
return true
end
function M.modify_build(make)
make:match("html?$", process)
local matches = make.matches
-- the filters should be first match to be executed, especially if tidy
-- should be executed as well
if #matches > 1 then
local last = matches[#matches]
table.insert(matches, 1, last)
matches[#matches] = nil
end
return make
end
return M
|