mirror of
https://github.com/erusev/parsedown.git
synced 2024-09-19 19:41:29 +02: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))
|
if (isset($CurrentBlock))
|
||||||
{
|
{
|
||||||
$CurrentBlock['interrupted'] = true;
|
$CurrentBlock['interrupted'] = (isset($CurrentBlock['interrupted'])
|
||||||
|
? $CurrentBlock['interrupted'] + 1 : 1
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
@ -388,7 +390,7 @@ class Parsedown
|
|||||||
{
|
{
|
||||||
if (isset($Block['interrupted']))
|
if (isset($Block['interrupted']))
|
||||||
{
|
{
|
||||||
$Block['element']['element']['text'] .= "\n";
|
$Block['element']['element']['text'] .= str_repeat("\n", $Block['interrupted']);
|
||||||
|
|
||||||
unset($Block['interrupted']);
|
unset($Block['interrupted']);
|
||||||
}
|
}
|
||||||
@ -500,7 +502,7 @@ class Parsedown
|
|||||||
|
|
||||||
if (isset($Block['interrupted']))
|
if (isset($Block['interrupted']))
|
||||||
{
|
{
|
||||||
$Block['element']['element']['text'] .= "\n";
|
$Block['element']['element']['text'] .= str_repeat("\n", $Block['interrupted']);
|
||||||
|
|
||||||
unset($Block['interrupted']);
|
unset($Block['interrupted']);
|
||||||
}
|
}
|
||||||
|
@ -6,3 +6,8 @@ echo $message;</code></pre>
|
|||||||
<pre><code>> not a quote
|
<pre><code>> not a quote
|
||||||
- not a list item
|
- 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>
|
@ -8,3 +8,10 @@
|
|||||||
> not a quote
|
> not a quote
|
||||||
- not a list item
|
- not a list item
|
||||||
[not a reference]: http://foo.com
|
[not a reference]: http://foo.com
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
foo
|
||||||
|
|
||||||
|
|
||||||
|
bar
|
@ -12,3 +12,7 @@ echo "Hello World";
|
|||||||
<pre><code>the following isn't quite enough to close
|
<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>
|
@ -29,3 +29,10 @@ the following isn't quite enough to close
|
|||||||
```
|
```
|
||||||
still a fenced code block
|
still a fenced code block
|
||||||
````
|
````
|
||||||
|
|
||||||
|
```
|
||||||
|
foo
|
||||||
|
|
||||||
|
|
||||||
|
bar
|
||||||
|
```
|
Loading…
Reference in New Issue
Block a user