Skip to content

Type-4 HTML block does not interrupt a paragraph #223

Description

@lo48576

Description

<!a> is a type-4 HTML block.

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

--- https://spec.commonmark.org/0.30/#html-blocks

And the same section says:

All types of HTML blocks except type 7 may interrupt a paragraph.

Thus, <!a> is expected to interrupt paragraphs, if I understand correctly.
However, commonmark.js demo emits unexpected output.

Case 1

input:

> foo
<!a>
> bar

expected output:

<blockquote>
<p>foo</p>
</blockquote>
<!a>
<blockquote>
<p>bar</p>
</blockquote>

actual output: (https://spec.commonmark.org/dingus/?text=%3E%20foo%0A%3C!a%3E%0A%3E%20bar)

<blockquote>
<p>foo
&lt;!a&gt;
bar</p>
</blockquote>

Case 2

input:

foo
<!a>
bar

expected output:

<p>foo</p>
<!a>
<p>bar</p>

actual output: (https://spec.commonmark.org/dingus/?text=foo%0A%3C!a%3E%0Abar)

<p>foo
&lt;!a&gt;
bar</p>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions