minify-html icon indicating copy to clipboard operation
minify-html copied to clipboard

Lost closing tags when used with KaTeX

Open D-Sketon opened this issue 4 months ago • 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>

D-Sketon avatar Feb 20 '24 11:02 D-Sketon