Text after an empty nested blockquote is dropped (18.0.9+)
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 37.2k
- Forks
- 3.7k
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 19
Description
Marked version: 18.0.9 through 18.0.13 (18.0.8 is fine)
Describe the bug
Text on the line after an empty nested blockquote is dropped from the output, with default options.
To Reproduce
marked.parse('>>\ntext') in 18.0.8, matching the dingus:
<blockquote>
<blockquote>
</blockquote>
</blockquote>
<p>text</p>
In 18.0.9 to 18.0.13:
<blockquote>
<blockquote>
</blockquote>
</blockquote>
Same for >>>\ntext and > quote\n>>\ntext. With >>\ntext\n> more, the following > more blockquote disappears as well.
Expected behavior
The empty nested blockquote closes and text becomes a paragraph after it, as in CommonMark and 18.0.8.
This looks like it comes from #4030: the continuation branch in Tokenizer.blockquote() now appends every continuation line to raw, also when the re-tokenized nested blockquote did not consume them, so the lexer skips past text no token holds. Reverting that commit brings the paragraph back. I have a small fix with a spec test in test/specs/new/ and would be glad to open a PR if that is welcome.
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
Start by reading Tokenizer.blockquote() and the change referenced in #4030, then reproduce the issue with the nested blockquote examples in the report. Add or inspect the spec test in test/specs/new/ and verify that text after an empty nested blockquote is preserved while the existing blockquote cases still pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, markdown
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100