Commonmark's handling of lines beginning with html comment #9317
-
I see this difference in the way that the Commonmark reader in recent versions of Pandoc (currently using 3.1.11.1) processes lines containing html comments. If the comment is not at the start of a line, it will be parsed into an Inline element:
but if the comment is at the start of a line (preceded by optional whitespace), then even when I would have expected it to still be an Inline element, it's getting parsed as a Block:
This behavior surprised me. I would have expected the commented line to be a Block element if it occupied the whole line, and certainly if it was surrounded by blank lines. But here I intuitively expected it to be recognized as Inline. Does the behavior noted here conform to the Commonmark spec? I'll look for myself, but thought I'd ask because the spec is detailed and keeps evolving (at least, more rapidly than I keep up with), so someone else may know better and faster than I'm able to figure out for myself. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yes, it's a #2 HTML block. The spec hasn't changed recently in this regard. |
Beta Was this translation helpful? Give feedback.
Yes, it's a #2 HTML block. The spec hasn't changed recently in this regard.
https://spec.commonmark.org/0.30/#html-blocks
I can see that this isn't ideal. Perhaps raise an issue at commonmark.