mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
consistent li items for loose list
This commit is contained in:
parent
1196ed9512
commit
0e1043a8d6
@ -515,10 +515,10 @@ class Parsedown
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
if($name === 'ol')
|
if($name === 'ol')
|
||||||
{
|
{
|
||||||
$listStart = stristr($matches[0], '.', true);
|
$listStart = stristr($matches[0], '.', true);
|
||||||
|
|
||||||
if($listStart !== '1')
|
if($listStart !== '1')
|
||||||
{
|
{
|
||||||
$Block['element']['attributes'] = array('start' => $listStart);
|
$Block['element']['attributes'] = array('start' => $listStart);
|
||||||
@ -547,6 +547,8 @@ class Parsedown
|
|||||||
{
|
{
|
||||||
$Block['li']['text'] []= '';
|
$Block['li']['text'] []= '';
|
||||||
|
|
||||||
|
$Block['loose'] = true;
|
||||||
|
|
||||||
unset($Block['interrupted']);
|
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
|
# Quote
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user