voku / HtmlMin

:clamp: HtmlMin: HTML Compressor and Minifier via PHP
MIT License
161 stars 22 forks source link

Self-closing tag "hr" is creating closing tag when minifying #17

Closed marcortola closed 6 years ago

marcortola commented 6 years ago

Self-closing tag "hr" is creating closing tag when minifying the HTML code. It seems to happen when executing this function: https://github.com/voku/HtmlMin/blob/c7ad42994320a6c743ee02e0e5c604866a42d22d/src/voku/helper/HtmlMin.php#L1074-L1077

This makes the minifier to produce bad HTML markup that does not pass the W3C validation throwing this error: Stray end tag “hr”.

How can I reproduce it?

Try to minify <hr> or <hr/>

voku commented 6 years ago

thanks for the bug-report ... fixed in version 3.0.2