jgm/commonmark-hs

[fuzz result] HTML declaration blocks do not follow spec 0.30

Closed this issue · 0 comments

HTML block condition 4 says:

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

commonmark-hs only accepts it if it's capitalized (which is what 0.29 said, but was changed in the current spec version). The first line is parsed as an HTML block, but the third line isn't, and it should be:

<!X

>

<!x

>

I incorrectly opened an issue at commonmark/cmark#528 because I had an outdated copy of commonmark.js. The latest version is actually fine.

Events from pulldown-cmark:

"<!p\n" -> [
  Start(HtmlBlock)
    Html(Boxed("<!p"))
  End(HtmlBlock)
]

Events from pandoc:

"<!p\n" -> [
  Start(Paragraph)
    Text(Boxed("<!p"))
  End(Paragraph)
]

Events from commonmark.js:

"<!p\n" -> [
  Start(Paragraph)
    Text(Boxed("<!p"))
  End(Paragraph)
]

AST from pandoc:

Pandoc {
    meta: {},
    blocks: [
        Para(
            [
                Str(
                    "<!p",
                ),
            ],
        ),
    ],
}