Skip to content

Commit

Permalink
Prevent breaking remaining previously compliant CommonMarkWeak tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aidantwoods authored Oct 13, 2016
1 parent 0a43799 commit 6973302
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Parsedown.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ protected function lines(array $lines, $parentType = null)

if (isset($CurrentBlock['continuable']))
{
$Block = $this->{'block'.$CurrentBlock['type'].'Continue'}($Line, $CurrentBlock);
$Block = $this->{'block'.$CurrentBlock['type'].'Continue'}($Line, $CurrentBlock, $parentType);

if (isset($Block))
{
Expand Down Expand Up @@ -449,7 +449,7 @@ protected function blockFencedCode($Line)
}
}

protected function blockFencedCodeContinue($Line, $Block)
protected function blockFencedCodeContinue($Line, $Block, $parentType)
{
if (isset($Block['complete']))
{
Expand All @@ -472,6 +472,11 @@ protected function blockFencedCodeContinue($Line, $Block)
return $Block;
}

if ($parentType === 'List')
{
$Line['body'] = preg_replace('/^[ ]{0,'.min(4, $Line['indent']).'}/', '', $Line['body']);
}

$Block['element']['text']['text'] .= "\n".$Line['body'];;

return $Block;
Expand Down

0 comments on commit 6973302

Please sign in to comment.