diff --git a/Parsedown.php b/Parsedown.php index ececf78..de80f3f 100644 --- a/Parsedown.php +++ b/Parsedown.php @@ -562,8 +562,10 @@ class Parsedown return null; } + $requiredIndent = ($Block['indent'] + strlen($Block['data']['marker'])); + if ( - $Block['indent'] === $Line['indent'] + $Line['indent'] < $requiredIndent and ( ( @@ -589,6 +591,8 @@ class Parsedown $text = isset($matches[1]) ? $matches[1] : ''; + $Block['indent'] = $Line['indent']; + $Block['li'] = array( 'name' => 'li', 'handler' => 'li', @@ -601,7 +605,7 @@ class Parsedown return $Block; } - elseif ($Block['indent'] === $Line['indent'] and $this->blockList($Line)) + elseif ($Line['indent'] < $requiredIndent and $this->blockList($Line)) { return null; } @@ -611,8 +615,6 @@ class Parsedown return $Block; } - $requiredIndent = ($Block['indent'] + strlen($Block['data']['marker'])); - if ($Line['indent'] >= $requiredIndent) { if (isset($Block['interrupted'])) @@ -631,7 +633,6 @@ class Parsedown if ( ! isset($Block['interrupted'])) { - // TODO: force multi-line paragraph, this must not parse any new block $text = preg_replace('/^[ ]{0,'.$requiredIndent.'}/', '', $Line['body']); $Block['li']['text'] []= $text;