summaryrefslogtreecommitdiff
path: root/support/make4ht
diff options
context:
space:
mode:
Diffstat (limited to 'support/make4ht')
-rw-r--r--support/make4ht/changelog.tex19
-rw-r--r--support/make4ht/domfilters/make4ht-mathmlfixes.lua25
-rw-r--r--support/make4ht/formats/make4ht-odt.lua10
-rwxr-xr-xsupport/make4ht/make4ht2
-rw-r--r--support/make4ht/make4ht-doc.pdfbin152568 -> 152668 bytes
5 files changed, 50 insertions, 6 deletions
diff --git a/support/make4ht/changelog.tex b/support/make4ht/changelog.tex
index d1b9b22219..8747cc4bf5 100644
--- a/support/make4ht/changelog.tex
+++ b/support/make4ht/changelog.tex
@@ -3,6 +3,25 @@
\begin{itemize}
\item
+ 2021/10/11
+
+ \begin{itemize}
+ \tightlist
+ \item
+ version \texttt{0.3j} released.
+ \end{itemize}
+\item
+ 2021/10/09
+
+ \begin{itemize}
+ \tightlist
+ \item
+ fixed wrong DOM object name in the ODT format.
+ \item
+ add addtional \texttt{\textless{}mrow\textgreater{}} elements when
+ necessary.
+ \end{itemize}
+\item
2021/09/30
\begin{itemize}
diff --git a/support/make4ht/domfilters/make4ht-mathmlfixes.lua b/support/make4ht/domfilters/make4ht-mathmlfixes.lua
index 55c0da379b..42f1e55775 100644
--- a/support/make4ht/domfilters/make4ht-mathmlfixes.lua
+++ b/support/make4ht/domfilters/make4ht-mathmlfixes.lua
@@ -37,6 +37,30 @@ local function fix_nested_mstyle(el)
end
end
+-- if element contains
+-- wrap everything in <mrow>
+local function top_mrow(math)
+ local children = math:get_children()
+ local put_mrow = false
+ -- don't process elements with one or zero children
+ -- don't process elements that already are mrow
+ if #children < 2 or math:get_element_name() == "mrow" then return nil end
+ for _,v in ipairs(children) do
+ if v:is_element() and is_token_element(v) then
+ put_mrow = true
+ break
+ end
+ end
+ if put_mrow then
+ local mrow = math:create_element("mrow")
+ for _, el in ipairs(children) do
+ mrow:add_child_node(el)
+ end
+ math._children = {mrow}
+ end
+
+end
+
local function get_fence(el, attr, form)
-- convert fence attribute to <mo> element
-- attr: open | close
@@ -108,6 +132,7 @@ return function(dom)
end
fix_token_elements(el)
fix_nested_mstyle(el)
+ top_mrow(el)
end)
return dom
end
diff --git a/support/make4ht/formats/make4ht-odt.lua b/support/make4ht/formats/make4ht-odt.lua
index 257e597bb3..f3721eba00 100644
--- a/support/make4ht/formats/make4ht-odt.lua
+++ b/support/make4ht/formats/make4ht-odt.lua
@@ -127,7 +127,7 @@ local function fix_picture_sizes(tmpdir)
end
local content = f:read("*all") or ""
f:close()
- local status, domobject = pcall(function()
+ local status, dom= pcall(function()
return domobject.parse(content)
end)
if not status then
@@ -224,13 +224,13 @@ function M.modify_build(make)
-- expanded in tex4ht.env in Miktex or Debian
call_xtpipes(make)
-- fix the image dimensions wrongly set by xtpipes
- local domfilters = domfilter {"t4htlinks", "odtpartable"}
+ local domfilters = domfilter({"t4htlinks", "odtpartable"}, "odtfilters")
make:match("4oo$", domfilters)
- -- fixes for mathml
- local mathmldomfilters = domfilter {"joincharacters","mathmlfixes"}
- make:match("4om$", mathmldomfilters)
-- execute it before xtpipes, because we don't want xtpipes to mess with t4htlink elements
move_matches(make)
+ -- fixes for mathml
+ local mathmldomfilters = domfilter({"joincharacters","mathmlfixes"}, "mathmlfilters")
+ make:match("4om$", mathmldomfilters)
-- convert XML entities for Unicode characters produced by Xtpipes to characters
local fixentities = filter {"entities-to-unicode", remove_xtpipes}
make:match("4oo", fixentities)
diff --git a/support/make4ht/make4ht b/support/make4ht/make4ht
index 1e7b0d73df..74a9c22d2b 100755
--- a/support/make4ht/make4ht
+++ b/support/make4ht/make4ht
@@ -29,7 +29,7 @@ make4ht [options] filename ["tex4ht.sty op." "tex4ht op." "t4ht op" "latex op"]
-- set version number. the template should be replaced by the
-- actual version number by the build script
-local version = "v0.3i"
+local version = "v0.3j"
mkparams.version_number = version
local args = mkparams.get_args()
diff --git a/support/make4ht/make4ht-doc.pdf b/support/make4ht/make4ht-doc.pdf
index 0b6b155444..58ce628888 100644
--- a/support/make4ht/make4ht-doc.pdf
+++ b/support/make4ht/make4ht-doc.pdf
Binary files differ