-
Notifications
You must be signed in to change notification settings - Fork 19
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
tl does not properly handle "void" closing tags. #37
Comments
Ah right, good catch. I suspect this might affect performance quite a lot if we always have to check if the closing tag is a void tag every time (although I could be wrong). |
the only case that wouldn't work is nested "voided" tags. however, the tags are never pushed to the parser stack. So there is no chance of them becoming nested as far as I'm aware. This does make me question how they become visible in the output. Are they treated as I'll adjust my fix to use the method you just mentioned and I'll open a pull request. |
Fixes #37 This pull request fixes the issue where void closing tags would not be ignored. Causing the closing tag to close the parent instead of the voided tag. To implement this, I had to also fix the ``tag_raw_abrupt_stop`` test. Because this would not treat the ``eof`` as a valid end of a identifier. Causing the identifier parsing of the closing tag to fail.
When I was attempting to parse a html page. I received a puzzling result from the parser. where the
head
tag would terminate early on a child tag. And the closinghtml
tag would be omitted.I have found that this is due to how "void" tags are ignored. And would like to get your opinion on my deduction of the problem.
let's take the following sample html:
the output of the parser currently is
as you can see, the
head
closing tag is abnormally placed after thebase
closing tag.after some debugging with tests i found the issue in the parser code, the tag parser properly ignores start tags. but if you hit a "void" closing tag it just treats the previously found tag as the closed tag. causing it to terminate the parent tag early.
I have written a fix for this by parsing the closing tag, and then not pushing the result if the closing tag is one of the "void" tags. Would you accept a pull request for this bug?
The text was updated successfully, but these errors were encountered: