commonmark / cmark

CommonMark parsing and rendering library and program in C
Other
1.6k stars 534 forks source link

Parsing of inline HTML declaration is stricter than spec #456

Closed xiaq closed 1 year ago

xiaq commented 1 year ago

According to the spec (https://spec.commonmark.org/0.30/#declaration), <!A> should be a valid declaration. But cmark requires there to be a space:

$ echo 'a <!A>' | cmark
<p>a &lt;!A&gt;</p>
$ echo 'a <!A >' | cmark
<p>a <!-- raw HTML omitted --></p>

commonmark.js has the same behavior (https://spec.commonmark.org/dingus/?text=a%20%3C!A%3E%0A%0Aa%20%3C!A%20%3E).