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

Count number of interrupts

This commit is contained in:
Aidan Woods 2018-04-09 14:13:10 +01:00
parent 9a021b2130
commit 3f5b0ee781
No known key found for this signature in database
GPG Key ID: 9A6A8EFAA512BBB9

View File

@ -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']);
} }