-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle illegal self-closing according to spec #136
Comments
This makes sense but most probably is a BC break 😿 |
Is it rally a BC break if the parser gets closer to spec (or browser behavior, as an extension of the spec)? |
Right. The README starts with "HTML5 is a standards-compliant HTML5 parser". It isn't quite, but fixing this bug would get it a little closer. |
The title of this issue is a bit confusing because I did not understand that this browser behaviour is according to spec until I investigated further. See the URL I linked in my PR. Self-closing tags do not exist in HTML5, are an error, and therefore ignored by browsers, except for foreign elements. See also: https://www.w3.org/TR/html5/syntax.html#start-tags |
Browsers will parse
like this (proof)
Whereas this parser will parse it like this
This is because the
Tokenizer
emitsendTag
after all self-closing tags. It should really only do this for tags that may be self-closed (ie, void elements and foreign elements).The text was updated successfully, but these errors were encountered: