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 heading, hr or html block (#4115)
This commit is contained in:
+2
-2
@@ -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
|
||||
Reference in New Issue
Block a user