Description
This is a follow-up issue for #836 (btw: thanks for the fix).
Using a slightly different example as in the referenced issue:
<html>
<head></head>
<body>
\begin{alignat*}{2}% Use alignat when you wish to have individual equation numbering
&l_{00} y_{0} && = b_{0} \\
&l_{10} y_{0} + l_{11} y_{1} && = b_{1} \\
&l_{20} y_{0} + l_{21} y_{1} + l_{22} y_{2} && = b_{2}
\end{alignat*}
<pre>
<code class="language-latex">
\documentclass{scrartcl}
\usepackage{amsmath}
\begin{document}
\begin{alignat*}{2}% Use alignat when you wish to have individual equation numbering
&l_{00} y_{0} && = b_{0} \\
&l_{10} y_{0} + l_{11} y_{1} && = b_{1} \\
&l_{20} y_{0} + l_{21} y_{1} + l_{22} y_{2} && = b_{2}
\end{alignat*}
\end{document}
</code>
</pre>
</body>
</html>
and calling the CLI-version (3.5.11) via html-minifier --minify-js --minify-css --remove-comments --remove-empty-attributes --remove-redundant-attributes --collapse-whitespace --ignore-custom-fragments "\\begin{alignat\*}[\s\S]*?\\end{alignat\*}" --decode-entities input.html
(note the additional parameter --decode-entities
) produces the following output:
<html><head></head><body> \begin{alignat*}{2}% Use alignat when you wish to have individual equation numbering
&l_{00} y_{0} && = b_{0} \\
&l_{10} y_{0} + l_{11} y_{1} && = b_{1} \\
&l_{20} y_{0} + l_{21} y_{1} + l_{22} y_{2} && = b_{2}
\end{alignat*} <pre>
<code class="language-latex">
\documentclass{scrartcl}
\usepackage{amsmath}
\begin{document}
\begin{alignat*}{2}% Use alignat when you wish to have individual equation numbering
&amp;l_{00} y_{0} &amp;&amp; = b_{0} \\
&amp;l_{10} y_{0} + l_{11} y_{1} &amp;&amp; = b_{1} \\
&amp;l_{20} y_{0} + l_{21} y_{1} + l_{22} y_{2} &amp;&amp; = b_{2}
\end{alignat*}
\end{document}
</code>
</pre></body></html>
The whitespace inside the code
-block stays now untouched but, unfortunately, the entity &
gets messed up. This seems to be related to the custom ignore fragment inside the code
-block, though, since in the first alignat
environment (without a surrounding code
-block) the entities remain unchanged.