Last active
December 9, 2019 22:40
-
-
Save j9t/fa19e217a1188e200547 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<title>␣</title> |
@wooorm, interesting! Yet I read the spec that there must be either of U+0009, U+000A, U+000C, or U+0020, and not no character to proceed. Which would be backed by validation of the snippet. Although a version without a space would be shorter (and likewise one without a line break between DOCTYPE and title
, I might for once vote for leaving those characters :)
Right, that is reasonable! 👍 To clarify: yes, it is a parse error, which conformance checkers like the validator should report, but parse errors are well defined in the HTML spec (e.g., <div id=a id=b>
is a parse error, but works the same in browsers following the spec)
Also, gzipped doctype
saves 2 bytes over DOCTYPE
. 🎉
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@j9t There is a shorter version (if we’re allowing parse errors, which user agents do)! You don’t need the space between
DOCTYPE
andhtml
! https://html.spec.whatwg.org/multipage/parsing.html#doctype-state