Skip to content
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

_inputstream.EncodingParser fails to parse short bogus comments (prescan) #427

Open
openandclose opened this issue Oct 26, 2019 · 1 comment

Comments

@openandclose
Copy link

I think abrupt-closing-of-empty-comment ('<!-->' and '<!--->')
should be treated as normal comments in prescan as well.

for '<!-->', the spec states rather explicitly.

The two 0x2D bytes can be the same as those in the '<!--' sequence.'

prescan:
https://html.spec.whatwg.org/multipage/parsing.html#prescan-a-byte-stream-to-determine-its-encoding
abrupt-closing-of-empty-comment:
https://html.spec.whatwg.org/multipage/parsing.html#parse-error-abrupt-closing-of-empty-comment

C.f.
jsdom/html-encoding-sniffer has the same bug.
jsdom/html-encoding-sniffer#4
Validator treats them as comments.

@domenic
Copy link

domenic commented Jan 5, 2020

Confirmed the spec says to treat them as comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants