fix: end blockquote before a lazy line after a heading, hr or html block (#4115)

This commit is contained in:
Ngo Quoc Viet
2026-10-06 08:57:07 -06:00
committed by GitHub
parent ec3a4e511a
commit 9e64a6a3fe
3 changed files with 37 additions and 2 deletions
+2 -2
View File
@@ -251,8 +251,8 @@ export class _Tokenizer<ParserOutput = string, RendererOutput = string> {
const lastToken = tokens.at(-1);
if (lastToken?.type === 'code') {
// blockquote continuation cannot be preceded by a code block
if (lastToken?.type === 'code' || lastToken?.type === 'heading' || lastToken?.type === 'hr' || lastToken?.type === 'html') {
// blockquote continuation cannot be preceded by a code block, heading, hr or html block
break;
} else if (lastToken?.type === 'blockquote') {
// include continuation in nested blockquote
@@ -0,0 +1,20 @@
<blockquote>
<h1>heading</h1>
</blockquote>
<p>not quoted</p>
<blockquote>
<h2>setext heading</h2>
</blockquote>
<p>not quoted</p>
<blockquote>
<hr />
</blockquote>
<p>not quoted</p>
<blockquote>
<div>
</blockquote>
<p>not quoted</p>
<blockquote>
<!-- comment -->
</blockquote>
<p>not quoted</p>
@@ -0,0 +1,15 @@
> # heading
not quoted
> setext heading
> ---
not quoted
> ***
not quoted
> <div>
not quoted
> <!-- comment -->
not quoted