Skip to content

Commit

Permalink
consistent li items for loose list
Browse files Browse the repository at this point in the history
  • Loading branch information
aidantwoods committed Jan 29, 2018
1 parent 1196ed9 commit 0e1043a
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions Parsedown.php
Original file line number Diff line number Diff line change
Expand Up @@ -515,10 +515,10 @@ protected function blockList($Line)
),
);

if($name === 'ol')
if($name === 'ol')
{
$listStart = stristr($matches[0], '.', true);

if($listStart !== '1')
{
$Block['element']['attributes'] = array('start' => $listStart);
Expand Down Expand Up @@ -547,6 +547,8 @@ protected function blockListContinue($Line, array $Block)
{
$Block['li']['text'] []= '';

$Block['loose'] = true;

unset($Block['interrupted']);
}

Expand Down Expand Up @@ -595,6 +597,22 @@ protected function blockListContinue($Line, array $Block)
}
}

protected function blockListComplete(array $Block)
{
if (isset($Block['loose']))
{
foreach ($Block['element']['text'] as &$li)
{
if (end($li['text']) !== '')
{
$li['text'] []= '';
}
}
}

return $Block;
}

#
# Quote

Expand Down

0 comments on commit 0e1043a

Please sign in to comment.