Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
3 changes: 3 additions & 0 deletions test/specs/new/blockquote_whitespace_only_empty.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<blockquote>
</blockquote>
<p>b</p>
2 changes: 2 additions & 0 deletions test/specs/new/blockquote_whitespace_only_empty.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>
b
8 changes: 8 additions & 0 deletions test/specs/new/blockquote_whitespace_only_line.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<blockquote>
<p>a</p>
</blockquote>
<p>b</p>
<blockquote>
<p>c</p>
</blockquote>
<p>d</p>
7 changes: 7 additions & 0 deletions test/specs/new/blockquote_whitespace_only_line.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
> a
>
b

> c
>
d
Loading