commonmark / cmark

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

HTML comments do not follow the 0.30 spec #476

Open zombiezen opened 1 year ago

zombiezen commented 1 year ago

cmark 0.30.3 does not follow the spec for Example 625 and Example 626.

Example input to cmark --unsafe:

foo <!-- not a comment -- two hyphens -->

foo <!--> foo -->

foo <!-- foo--->

Expected output:

<p>foo &lt;!-- not a comment -- two hyphens --&gt;</p>
<p>foo &lt;!--&gt; foo --&gt;</p>
<p>foo &lt;!-- foo---&gt;</p>

Actual output:

<p>foo <!-- not a comment -- two hyphens --></p>
<p>foo <!--> foo --&gt;</p>
<p>foo &lt;!-- foo---&gt;</p>