fix: end a block quote at a lazy line after an empty list item (#4178)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Wei-Lun Li
2026-11-16 09:20:44 -07:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 0b8b3b3386
commit e2f77b4b72
3 changed files with 47 additions and 0 deletions
+6
View File
@@ -338,6 +338,12 @@ export class _Tokenizer<ParserOutput = string, RendererOutput = string> {
text = `${text}\n${consumed}`;
}
lines = lines.slice(consumedCount);
// A lazy line the list did not take is not a paragraph continuation,
// e.g. after an empty list item, so it ends the blockquote.
if (lines.length > 0 && !this.rules.other.blockquoteStart.test(lines[0])) {
break;
}
continue;
}
}
@@ -0,0 +1,29 @@
<blockquote>
<ul>
<li></li>
</ul>
</blockquote>
<p>foo</p>
<blockquote>
<ol>
<li></li>
</ol>
</blockquote>
<p>bar</p>
<blockquote>
<blockquote>
<ul>
<li></li>
</ul>
</blockquote>
</blockquote>
<p>baz</p>
<blockquote>
<ul>
<li></li>
</ul>
</blockquote>
<p>qux</p>
<blockquote>
<p>quux</p>
</blockquote>
@@ -0,0 +1,12 @@
> -
foo
> 1.
bar
> > *
baz
> -
qux
> quux