minify-html
minify-html copied to clipboard
HTML comments minified improperly
original:
<p><!----> <!----> <!----> <!----> <!----> <!----> <!----></p>
minified:
Cfg | result | intended |
---|---|---|
(default) | <p>⬜⬜⬜⬜ |
<p> |
keep_comments | <p><!----><!---->⬜<!---->⬜<!---->⬜<!---->⬜<!----><!----> |
<p><!----><!----><!----><!----><!----><!----><!----></p> ~(or <p><!----><!----><!----><!----><!----><!----><!----> ?)~ |
keep_closing_tags | <p>⬜⬜⬜⬜</p> |
<p></p> |
keep_comments, keep_closing_tags | <p><!----><!---->⬜<!---->⬜<!---->⬜<!---->⬜<!----><!----></p> |
<p><!----><!----><!----><!----><!----><!----><!----></p> |
(Spaces will be trimmed by GitHub in some conditions, so I replaced them with ⬜
)
FYI: Python 3.10.1 (tags/v3.10.1:2cd268a, Dec 6 2021, 19:10:37) [MSC v.1929 64 bit (AMD64)] on win32 minify-html 0.8.0
Good points, thanks for raising. There have been issues I've encountered with comments and minification, as minify-html parses sequentially and does not build a tree for performance and memory reasons. I will investigate ways to work around comments, but if they're too complex or slow, I may simply remove the option to keep comments.
I consider that simply removing the option to keep comments is acceptable. Thanks for your work!