diff --git a/src/rules.ts b/src/rules.ts index 02e12330..2693902d 100644 --- a/src/rules.ts +++ b/src/rules.ts @@ -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(); diff --git a/test/specs/new/blockquote_whitespace_only_empty.html b/test/specs/new/blockquote_whitespace_only_empty.html new file mode 100644 index 00000000..c630a798 --- /dev/null +++ b/test/specs/new/blockquote_whitespace_only_empty.html @@ -0,0 +1,3 @@ +
+
+

b

diff --git a/test/specs/new/blockquote_whitespace_only_empty.md b/test/specs/new/blockquote_whitespace_only_empty.md new file mode 100644 index 00000000..c5d1e53a --- /dev/null +++ b/test/specs/new/blockquote_whitespace_only_empty.md @@ -0,0 +1,2 @@ +> +b diff --git a/test/specs/new/blockquote_whitespace_only_line.html b/test/specs/new/blockquote_whitespace_only_line.html new file mode 100644 index 00000000..c88b315b --- /dev/null +++ b/test/specs/new/blockquote_whitespace_only_line.html @@ -0,0 +1,8 @@ +
+

a

+
+

b

+
+

c

+
+

d

diff --git a/test/specs/new/blockquote_whitespace_only_line.md b/test/specs/new/blockquote_whitespace_only_line.md new file mode 100644 index 00000000..fa3a72cb --- /dev/null +++ b/test/specs/new/blockquote_whitespace_only_line.md @@ -0,0 +1,7 @@ +> a +> +b + +> c +> +d