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

Raw HTML declaration casing inconsistency between spec and reference parser #620

Closed
wooorm opened this issue Oct 30, 2019 · 4 comments
Closed

Comments

@wooorm
Copy link
Contributor

wooorm commented Oct 30, 2019

For block HTML, a declaration is as follows:

Start condition: line begins with the string <! followed by an uppercase ASCII letter.
End condition: line contains the character `.

For raw HTML (inline), it is as follows:

A declaration consists of the string <!, a name consisting of one or more uppercase ASCII letters, whitespace, a string of characters not including the character >, and the character >.


The reference parser does not seem to care about the inline HTML restriction on uppercase ASCII letters:

asd <!doctype html>

<!doctype html>

CM:

<p>asd <!doctype html></p>
<p><!doctype html></p>

Note that both are inline, and both “work”.


I am raising this issue here as I think a better solution is to change the spec, to allow ASCII lowercase alphas in declarations, as HTML also allows them.

@jgm
Copy link
Member

jgm commented Oct 30, 2019

If HTML allows them (can you link to the spec?) then certainly we should too.

@wooorm
Copy link
Contributor Author

wooorm commented Oct 30, 2019

Spec is here: https://html.spec.whatwg.org/multipage/parsing.html#markup-declaration-open-state

Note that HTML though, treats old XML stuff (declarations, instructions), as comments. Except for the (ASCII case-insensitive) DOCTYPE declaration. So it only looks at <! and then waits for >.

Aside: W3C recently decided to stop the fight with WHATWG

@jgm
Copy link
Member

jgm commented Oct 30, 2019

OK, let's change this. Do you want to do a PR?

@wooorm
Copy link
Contributor Author

wooorm commented Oct 30, 2019

Done!

@jgm jgm closed this as completed in df9d8cd Oct 31, 2019
robinst added a commit to commonmark/commonmark-java that referenced this issue Jun 29, 2021
notriddle added a commit to notriddle/pulldown-cmark that referenced this issue Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants