HTML: closing tag for '<p>' purged
Closed this issue · 2 comments
I was debugging why my HTML did not look as I would have figured and it turns out <p>
-tags are just not closed in the minified version.
echo '<p></p>' | minify --type html
results in <p>
.
While this minimal test case might not cause a difference in appearance, that happening within mark-up does make a difference, though.
Hi Mirko, thanks for the bug report. This is however not a bug but a feature! In most circumstances (and only in those will minify do so), the closing of P or LI tags is completely optional. This will never cause a difference in appearance, unless you're using a HTML5 non-compliant browser.
Interesting, thanks. In case someone else stumbles across this, in case one really needs the <p>
-tags being closed, minify has the option --html-keep-end-tags
to preserve them.