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
1 changed files with 5 additions and 3 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']);
}