kangax / html-minifier

Javascript-based HTML compressor/minifier (with Node.js support)
http://kangax.github.io/html-minifier/
MIT License
4.94k stars 571 forks source link

useShortDoctype: always add a space after `doctype` #1112

Closed XhmikosR closed 2 years ago

XhmikosR commented 2 years ago

Fixes #1053

IMHO removing this one space isn't worth it compared to outputting valid HTML.

mathiasbynens commented 2 years ago

See https://github.com/kangax/html-minifier/pull/970. This is a feature, not a bug!

mathiasbynens commented 2 years ago

The space is only omitted if the removeTagWhitespace option is enabled, in which case the minified result isn't guaranteed to be valid HTML anyway (with or withour your patch).

XhmikosR commented 2 years ago

Yeah, I just had a second thought and it's fine, indeed. Should have checked closer, all good!