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

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

View File

@ -7,4 +7,11 @@
> not a quote
- not a list item
[not a reference]: http://foo.com
[not a reference]: http://foo.com
---
foo
bar

View File

@ -11,4 +11,8 @@ echo "Hello World";
&lt;a href="http://auraphp.com" &gt;Aura Project&lt;/a&gt;</code></pre>
<pre><code>the following isn't quite enough to close
```
still a fenced code block</code></pre>
still a fenced code block</code></pre>
<pre><code>foo
bar</code></pre>

View File

@ -28,4 +28,11 @@ echo "Hello World";
the following isn't quite enough to close
```
still a fenced code block
````
````
```
foo
bar
```