mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Merge pull request #610 from aidantwoods/fix/lost-line-breaks
Fix lost line breaks
This commit is contained in:
commit
50f15add44
@ -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']);
|
||||
}
|
||||
|
@ -5,4 +5,9 @@ echo $message;</code></pre>
|
||||
<hr />
|
||||
<pre><code>> 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>
|
@ -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
|
@ -11,4 +11,8 @@ echo "Hello World";
|
||||
<a href="http://auraphp.com" >Aura Project</a></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>
|
@ -28,4 +28,11 @@ echo "Hello World";
|
||||
the following isn't quite enough to close
|
||||
```
|
||||
still a fenced code block
|
||||
````
|
||||
````
|
||||
|
||||
```
|
||||
foo
|
||||
|
||||
|
||||
bar
|
||||
```
|
Loading…
Reference in New Issue
Block a user