From caea78300609ecc335379fc88e4bd54f1a6928a4 Mon Sep 17 00:00:00 2001 From: Aidan Woods Date: Wed, 28 Mar 2018 03:24:01 +0100 Subject: [PATCH 1/3] Add failing test case --- test/data/simple_blockquote.html | 15 +++++++++++++++ test/data/simple_blockquote.md | 8 +++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/test/data/simple_blockquote.html b/test/data/simple_blockquote.html index 8225d57..9f9bfab 100644 --- a/test/data/simple_blockquote.html +++ b/test/data/simple_blockquote.html @@ -8,4 +8,19 @@

no space after >:

quote

+
+
+
+
+
+

Info 1 text

+
+
+
+
+
+
+

Info 2 text

+
+
\ No newline at end of file diff --git a/test/data/simple_blockquote.md b/test/data/simple_blockquote.md index 22b6b11..d7c3e12 100644 --- a/test/data/simple_blockquote.md +++ b/test/data/simple_blockquote.md @@ -4,4 +4,10 @@ indented: > quote no space after `>`: ->quote \ No newline at end of file +>quote + +--- + +>>> Info 1 text + +>>> Info 2 text \ No newline at end of file From 07216480dba97140aa38333c3be84421bfbbabb4 Mon Sep 17 00:00:00 2001 From: Aidan Woods Date: Wed, 28 Mar 2018 03:26:45 +0100 Subject: [PATCH 2/3] Change test to comply with CommonMark --- test/data/lazy_blockquote.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/data/lazy_blockquote.html b/test/data/lazy_blockquote.html index 0a2a2aa..dea3dca 100644 --- a/test/data/lazy_blockquote.html +++ b/test/data/lazy_blockquote.html @@ -1,6 +1,8 @@

quote the rest of it

+
+

another paragraph the rest of it

\ No newline at end of file From 92e426e0e893bf87f04aa586737f0dc394f073f3 Mon Sep 17 00:00:00 2001 From: Aidan Woods Date: Wed, 28 Mar 2018 03:27:09 +0100 Subject: [PATCH 3/3] Fix merging of adjacent blockquotes --- Parsedown.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Parsedown.php b/Parsedown.php index 0b00886..11e50d5 100644 --- a/Parsedown.php +++ b/Parsedown.php @@ -698,15 +698,13 @@ class Parsedown protected function blockQuoteContinue($Line, array $Block) { + if (isset($Block['interrupted'])) + { + return; + } + if ($Line['text'][0] === '>' and preg_match('/^>[ ]?(.*)/', $Line['text'], $matches)) { - if (isset($Block['interrupted'])) - { - $Block['element']['text'] []= ''; - - unset($Block['interrupted']); - } - $Block['element']['text'] []= $matches[1]; return $Block;