diff options
author | Karl Berry <karl@freefriends.org> | 2019-11-06 23:34:03 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-11-06 23:34:03 +0000 |
commit | af84b9db7fece90caa80d73b8faa9de75dd9e568 (patch) | |
tree | 745ebd7a73950d0e7099c47a66b6b3deefb2f4bd /Master/texmf-dist/scripts/make4ht/extensions/make4ht-ext-common_domfilters.lua | |
parent | 73e3f7c059fcd8089c33c01b6034e5ad3c9d50d6 (diff) |
make4ht (5nov19)
git-svn-id: svn://tug.org/texlive/trunk@52666 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/make4ht/extensions/make4ht-ext-common_domfilters.lua')
-rw-r--r-- | Master/texmf-dist/scripts/make4ht/extensions/make4ht-ext-common_domfilters.lua | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Master/texmf-dist/scripts/make4ht/extensions/make4ht-ext-common_domfilters.lua b/Master/texmf-dist/scripts/make4ht/extensions/make4ht-ext-common_domfilters.lua new file mode 100644 index 00000000000..9399492d907 --- /dev/null +++ b/Master/texmf-dist/scripts/make4ht/extensions/make4ht-ext-common_domfilters.lua @@ -0,0 +1,36 @@ +local M = {} + + +-- this variable will hold the output format name +local current_format + +local filter = require "make4ht-domfilter" +-- local process = filter {"fixinlines", "idcolons", "joincharacters" } + +-- filters support only html formats +function M.test(format) + current_format = format + -- if format == "odt" then return false end + return true +end + +function M.modify_build(make) + -- number of filters that should be moved to the beginning + local count = 0 + if current_format == "odt" then + -- some formats doesn't make sense in the ODT format + local process = filter {"joincharacters"} + local charclasses = {mn = true, ["text:span"] = true} + make:match("4oo$", process, {charclasses= charclasses}) + -- match math documents + make:match("4om$", process, {charclasses= charclasses}) + count = 2 + else + local process = filter {"fixinlines", "idcolons", "joincharacters", "tablerows"} + make:match("html$", process) + count = 1 + end + return make +end + +return M |