Use <!doctypehtml> (without the space) where possible
authorMathias Bynens <mathias@qiwi.be>
Fri, 5 Oct 2018 14:09:27 +0000 (16:09 +0200)
committerMathias Bynens <mathias@qiwi.be>
Fri, 5 Oct 2018 14:09:27 +0000 (16:09 +0200)
commit7e8406e3244d09197f440b5ef1736e99e2c37c13
tree758c6bb0fccec4cb138b76425488c524adde1d90
parentdf720b32ffdcda11025a75dc57acef4210a031f4
Use <!doctypehtml> (without the space) where possible

When both the `useShortDoctype` and the `removeTagWhitespace` options are enabled, we can remove the space from the doctype altogether.

It’s invalid HTML (which is already expected in the output with the `removeTagWhitespace` option enabled), but it still triggers standards mode.

https://html.spec.whatwg.org/multipage/parsing.html#parse-error-missing-whitespace-before-doctype-name
https://twitter.com/mathias/status/1048098677703753729

Closes #969.
src/htmlminifier.js
tests/minifier.js