fix: do not continue a block quote paragraph from a whitespace-only line (#4134)

This commit is contained in:
Osama Ansar
2026-10-25 23:32:52 -06:00
committed by GitHub
parent 4562b6f979
commit 42f34a8411
5 changed files with 23 additions and 1 deletions
+3 -1
View File
@@ -190,7 +190,9 @@ const paragraph = createParagraph(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/);
// paragraph, where an empty list cannot interrupt)
const blockquoteParagraph = createParagraph(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/);
const blockquote = edit(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/)
// a line with only whitespace after the marker is blank, so it must not start a
// paragraph that lazily continues onto the next line
const blockquote = edit(/^( {0,3}> ?(?:(?![ \t]*(?:\n|$))(paragraph)|[^\n]*)(?:\n|$))+/)
.replace('paragraph', blockquoteParagraph)
.getRegex();
@@ -0,0 +1,3 @@
<blockquote>
</blockquote>
<p>b</p>
@@ -0,0 +1,2 @@
>
b
@@ -0,0 +1,8 @@
<blockquote>
<p>a</p>
</blockquote>
<p>b</p>
<blockquote>
<p>c</p>
</blockquote>
<p>d</p>
@@ -0,0 +1,7 @@
> a
>
b
> c
>
d