mirror of
https://github.com/erusev/parsedown.git
synced 2024-09-20 03:51:29 +02:00
line indent from line whitespace after marker; more leneant on condition for indent match on list start (prevents test 243 breaking)
This commit is contained in:
parent
ab59a97161
commit
49ae7f9925
@ -599,14 +599,11 @@ class Parsedown
|
||||
|
||||
protected function blockListContinue($Line, array $Block)
|
||||
{
|
||||
if (preg_match('/^('.$Block['pattern'].')(?:[ ]+(.*)|$)/', $Line['text'], $matches))
|
||||
if (preg_match('/^('.$Block['pattern'].')([ ]+)(?:(.*)|$)/', $Line['text'], $matches))
|
||||
{
|
||||
if (isset($Block['markerWhitespace']))
|
||||
{
|
||||
$Line['indent'] += strlen($matches[1]) + $Block['markerWhitespace'];
|
||||
}
|
||||
$Line['indent'] += strlen($matches[1]) + strlen($matches[2]);
|
||||
|
||||
if ($Block['indent'] === $Line['indent'])
|
||||
if ($Block['indent'] - $Block['markerWhitespace'] <= $Line['indent'])
|
||||
{
|
||||
if (isset($Block['interrupted']))
|
||||
{
|
||||
@ -617,7 +614,7 @@ class Parsedown
|
||||
|
||||
unset($Block['li']);
|
||||
|
||||
$text = isset($matches[2]) ? $matches[2] : '';
|
||||
$text = isset($matches[3]) ? $matches[3] : '';
|
||||
|
||||
$Block['li'] = array(
|
||||
'name' => 'li',
|
||||
|
Loading…
Reference in New Issue
Block a user