-
Notifications
You must be signed in to change notification settings - Fork 84
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
HTML mode throws on mismatched tags #112
Comments
Seems to be a problem with parse5 location info. |
On further analysis I've found the cause of the problem |
From that issue, it looks like this parse5 behavior is intentional, and I agree, that's what is specified in the HTML5 specification and how browsers actually behave. When tags are misnested, the parser can synthesize extra elements where no explicit tag was given. This is an interesting case to try to render. We could either I think (a) might make more sense. If we are in such a situation and there is no begin-tag but there is an end-tag for an element, we might synthesize an "error block" to surround just the end-tag. |
Another minimal test document that we should untangle:
When we have an end-tag without a begin-tag we seem to lose track of things. I think we should probably highlight it as an error-tag block. |
I didn't realize that's how HTML5 spec has it! If its part of the spec, it should be part of this program |
We can close this now. |
Parse5 is able to parse the following document:
But when the HTML mode tries to blockify it it thows
Improper parser: block cannot nest immediately inside another block.
The text was updated successfully, but these errors were encountered: