Skip to content

Commit e7dcf52

Browse files
fix: end blockquote before a lazy line after a table (#4161)
1 parent 7ba42f4 commit e7dcf52

3 files changed

Lines changed: 69 additions & 2 deletions

File tree

‎src/Tokenizer.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,8 @@ export class _Tokenizer<ParserOutput = string, RendererOutput = string> {
260260

261261
const lastToken = tokens.at(-1);
262262

263-
if (lastToken?.type === 'code' || lastToken?.type === 'heading' || lastToken?.type === 'hr' || lastToken?.type === 'html') {
264-
// blockquote continuation cannot be preceded by a code block, heading, hr or html block
263+
if (lastToken?.type === 'code' || lastToken?.type === 'heading' || lastToken?.type === 'hr' || lastToken?.type === 'html' || lastToken?.type === 'table') {
264+
// blockquote continuation cannot be preceded by a code block, heading, hr, html block or table
265265
break;
266266
} else if (lastToken?.type === 'blockquote') {
267267
// include continuation in nested blockquote
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<blockquote>
2+
<table>
3+
<thead>
4+
<tr>
5+
<th>abc</th>
6+
<th>def</th>
7+
</tr>
8+
</thead>
9+
<tbody>
10+
<tr>
11+
<td>bar</td>
12+
<td>baz</td>
13+
</tr>
14+
</tbody>
15+
</table>
16+
</blockquote>
17+
<p>not quoted</p>
18+
<blockquote>
19+
<table>
20+
<thead>
21+
<tr>
22+
<th>abc</th>
23+
<th>def</th>
24+
</tr>
25+
</thead>
26+
<tbody>
27+
<tr>
28+
<td>bar</td>
29+
<td>baz</td>
30+
</tr>
31+
</tbody>
32+
</table>
33+
</blockquote>
34+
<p>not quoted</p>
35+
<blockquote>
36+
<blockquote>
37+
<table>
38+
<thead>
39+
<tr>
40+
<th>abc</th>
41+
<th>def</th>
42+
</tr>
43+
</thead>
44+
<tbody>
45+
<tr>
46+
<td>bar</td>
47+
<td>baz</td>
48+
</tr>
49+
</tbody>
50+
</table>
51+
</blockquote>
52+
</blockquote>
53+
<p>not quoted</p>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
> | abc | def |
2+
> | --- | --- |
3+
> | bar | baz |
4+
not quoted
5+
6+
> abc | def
7+
> --- | ---
8+
> bar | baz
9+
not quoted
10+
11+
> > | abc | def |
12+
> > | --- | --- |
13+
> > | bar | baz |
14+
not quoted

0 commit comments

Comments
 (0)