fix: end blockquote before a lazy line after a table (#4161)

This commit is contained in:
Ngo Quoc Viet
2026-11-02 07:55:25 -07:00
committed by GitHub
parent 7ba42f445c
commit e7dcf52ddb
3 changed files with 69 additions and 2 deletions
+2 -2
View File
@@ -260,8 +260,8 @@ export class _Tokenizer<ParserOutput = string, RendererOutput = string> {
const lastToken = tokens.at(-1);
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
if (lastToken?.type === 'code' || lastToken?.type === 'heading' || lastToken?.type === 'hr' || lastToken?.type === 'html' || lastToken?.type === 'table') {
// blockquote continuation cannot be preceded by a code block, heading, hr, html block or table
break;
} else if (lastToken?.type === 'blockquote') {
// include continuation in nested blockquote
@@ -0,0 +1,53 @@
<blockquote>
<table>
<thead>
<tr>
<th>abc</th>
<th>def</th>
</tr>
</thead>
<tbody>
<tr>
<td>bar</td>
<td>baz</td>
</tr>
</tbody>
</table>
</blockquote>
<p>not quoted</p>
<blockquote>
<table>
<thead>
<tr>
<th>abc</th>
<th>def</th>
</tr>
</thead>
<tbody>
<tr>
<td>bar</td>
<td>baz</td>
</tr>
</tbody>
</table>
</blockquote>
<p>not quoted</p>
<blockquote>
<blockquote>
<table>
<thead>
<tr>
<th>abc</th>
<th>def</th>
</tr>
</thead>
<tbody>
<tr>
<td>bar</td>
<td>baz</td>
</tr>
</tbody>
</table>
</blockquote>
</blockquote>
<p>not quoted</p>
@@ -0,0 +1,14 @@
> | abc | def |
> | --- | --- |
> | bar | baz |
not quoted
> abc | def
> --- | ---
> bar | baz
not quoted
> > | abc | def |
> > | --- | --- |
> > | bar | baz |
not quoted