consistent li items for loose list

This commit is contained in:
Aidan Woods 2017-02-19 16:12:04 +00:00
parent 1196ed9512
commit 0e1043a8d6
No known key found for this signature in database
GPG Key ID: 9A6A8EFAA512BBB9
1 changed files with 20 additions and 2 deletions

View File

@ -515,10 +515,10 @@ class Parsedown
),
);
if($name === 'ol')
if($name === 'ol')
{
$listStart = stristr($matches[0], '.', true);
if($listStart !== '1')
{
$Block['element']['attributes'] = array('start' => $listStart);
@ -547,6 +547,8 @@ class Parsedown
{
$Block['li']['text'] []= '';
$Block['loose'] = true;
unset($Block['interrupted']);
}
@ -595,6 +597,22 @@ class Parsedown
}
}
protected function blockListComplete(array $Block)
{
if (isset($Block['loose']))
{
foreach ($Block['element']['text'] as &$li)
{
if (end($li['text']) !== '')
{
$li['text'] []= '';
}
}
}
return $Block;
}
#
# Quote