wilsonzlin/minify-html

Lost closing tags when used with KaTeX

D-Sketon opened this issue · 0 comments

I tried to use minify-html in html containing KaTeX, but the closing tags are lost after compression, resulting in rendering error
Since KaTeX generates MathML, does minify-html support MathML? Or do I need to do any other configurations?
Here is the reproduction code

const { minify } = require("@minify-html/node");
const str = `
<mrow>
  <mspace width="2em"/>
</mrow>
`;
const res = minify(Buffer.from(str), {
  keep_spaces_between_attributes: true,
  keep_comments: true
}).toString()
console.log(res);

The output is: <mrow> <mspace width=2em>