From 4383cce85be0f4450116cef1abda2bf1a6a8f284 Mon Sep 17 00:00:00 2001 From: Emanuil Rusev Date: Thu, 15 Jan 2015 22:31:31 +0200 Subject: [PATCH] resolve #143 --- Parsedown.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Parsedown.php b/Parsedown.php index 75b6762..dbb8508 100755 --- a/Parsedown.php +++ b/Parsedown.php @@ -534,7 +534,7 @@ class Parsedown protected function blockListContinue($Line, array $Block) { - if ($Block['indent'] === $Line['indent'] and preg_match('/^'.$Block['pattern'].'[ ]+(.*)/', $Line['text'], $matches)) + if ($Block['indent'] === $Line['indent'] and preg_match('/^'.$Block['pattern'].'(?:[ ]+(.*)|$)/', $Line['text'], $matches)) { if (isset($Block['interrupted'])) { @@ -545,11 +545,13 @@ class Parsedown unset($Block['li']); + $text = isset($matches[1]) ? $matches[1] : ''; + $Block['li'] = array( 'name' => 'li', 'handler' => 'li', 'text' => array( - $matches[1], + $text, ), );