1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03:00

Merge pull request #586 from aidantwoods/fix/blockquote-adjacent

Fix merging of adjacent blockquotes
This commit is contained in:
Aidan Woods 2018-03-28 03:31:36 +01:00 committed by GitHub
commit 448b72a149
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 8 deletions

View File

@ -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;

View File

@ -1,6 +1,8 @@
<blockquote>
<p>quote
the rest of it</p>
</blockquote>
<blockquote>
<p>another paragraph
the rest of it</p>
</blockquote>

View File

@ -8,4 +8,19 @@
<p>no space after <code>&gt;</code>:</p>
<blockquote>
<p>quote</p>
</blockquote>
<hr />
<blockquote>
<blockquote>
<blockquote>
<p>Info 1 text</p>
</blockquote>
</blockquote>
</blockquote>
<blockquote>
<blockquote>
<blockquote>
<p>Info 2 text</p>
</blockquote>
</blockquote>
</blockquote>

View File

@ -4,4 +4,10 @@ indented:
> quote
no space after `>`:
>quote
>quote
---
>>> Info 1 text
>>> Info 2 text