commonmark / commonmark/commonmark.js
Type-4 HTML block does not interrupt a paragraph
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.6k
- Forks
- 231
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 3
Description
Description
<!a> is a type-4 HTML block.
- Start condition: line begins with the string
<!followed by an ASCII letter.
End condition: line contains the character>.
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
<!a>
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
<!a>
bar</p>
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the two Markdown examples from the issue in the commonmark.js demo and compare the actual HTML with the expected output. Trace the parser's handling of type-4 HTML blocks and paragraph interruption; done means both cases emit separate paragraphs or blockquotes with the raw HTML block between them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100