mirror of
https://github.com/markedjs/marked.git
synced 2026-11-30 16:48:05 +01:00
fix: end blockquote before a lazy line after a table (#4161)
This commit is contained in:
+2
-2
@@ -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
|
||||
Reference in New Issue
Block a user