Merge pull request #610 from aidantwoods/fix/lost-line-breaks

Fix lost line breaks
This commit is contained in:
Aidan Woods 2018-04-09 14:19:38 +01:00 committed by GitHub
commit 50f15add44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 32 additions and 7 deletions

View File

@ -182,7 +182,9 @@ class Parsedown
{
if (isset($CurrentBlock))
{
$CurrentBlock['interrupted'] = true;
$CurrentBlock['interrupted'] = (isset($CurrentBlock['interrupted'])
? $CurrentBlock['interrupted'] + 1 : 1
);
}
continue;
@ -388,7 +390,7 @@ class Parsedown
{
if (isset($Block['interrupted']))
{
$Block['element']['element']['text'] .= "\n";
$Block['element']['element']['text'] .= str_repeat("\n", $Block['interrupted']);
unset($Block['interrupted']);
}
@ -500,7 +502,7 @@ class Parsedown
if (isset($Block['interrupted']))
{
$Block['element']['element']['text'] .= "\n";
$Block['element']['element']['text'] .= str_repeat("\n", $Block['interrupted']);
unset($Block['interrupted']);
}

View File

@ -6,3 +6,8 @@ echo $message;</code></pre>
<pre><code>&gt; not a quote
- not a list item
[not a reference]: http://foo.com</code></pre>
<hr />
<pre><code>foo
bar</code></pre>

View File

@ -8,3 +8,10 @@
> not a quote
- not a list item
[not a reference]: http://foo.com
---
foo
bar

View File

@ -12,3 +12,7 @@ echo "Hello World";
<pre><code>the following isn't quite enough to close
```
still a fenced code block</code></pre>
<pre><code>foo
bar</code></pre>

View File

@ -29,3 +29,10 @@ the following isn't quite enough to close
```
still a fenced code block
````
```
foo
bar
```