1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03:00

remove ability for htmlblock to allow paragraph after if it closes on the same line

This commit is contained in:
Aidan Woods 2017-06-22 00:02:03 +01:00
parent 1d0af35f10
commit 6a4afac0d0
No known key found for this signature in database
GPG Key ID: 9A6A8EFAA512BBB9

View File

@ -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);
@ -697,32 +697,6 @@ class Parsedown
'markup' => $Line['text'], 'markup' => $Line['text'],
); );
$length = strlen($matches[0]);
$remainder = substr($Line['text'], $length);
if (trim($remainder) === '')
{
if (isset($matches[2]) or in_array($matches[1], $this->voidElements))
{
$Block['closed'] = true;
$Block['void'] = true;
}
}
else
{
if (isset($matches[2]) or in_array($matches[1], $this->voidElements))
{
return;
}
if (preg_match('/<\/'.$matches[1].'>[ ]*$/i', $remainder))
{
$Block['closed'] = true;
}
}
return $Block; return $Block;
} }
} }