diff --git a/Parsedown.php b/Parsedown.php index 1b9d6d5b..64e8a116 100644 --- a/Parsedown.php +++ b/Parsedown.php @@ -143,13 +143,13 @@ function setSafeMode($safeMode) protected function lines(array $lines) { - $CurrentBlock = null; + $CurrentBlock = array(); foreach ($lines as $line) { if (chop($line) === '') { - if (isset($CurrentBlock)) + if (!empty($CurrentBlock)) { $CurrentBlock['interrupted'] = true; } @@ -255,7 +255,7 @@ protected function lines(array $lines) # ~ - if (isset($CurrentBlock) and ! isset($CurrentBlock['type']) and ! isset($CurrentBlock['interrupted'])) + if (!empty($CurrentBlock) and ! isset($CurrentBlock['type']) and ! isset($CurrentBlock['interrupted'])) { $CurrentBlock['element']['text'] .= "\n".$text; } @@ -317,9 +317,9 @@ protected function isBlockCompletable($Type) # # Code - protected function blockCode($Line, $Block = null) + protected function blockCode($Line, $Block = array()) { - if (isset($Block) and ! isset($Block['type']) and ! isset($Block['interrupted'])) + if (!empty($Block) and ! isset($Block['type']) and ! isset($Block['interrupted'])) { return; } @@ -712,9 +712,9 @@ protected function blockRule($Line) # # Setext - protected function blockSetextHeader($Line, array $Block = null) + protected function blockSetextHeader($Line, array $Block = array()) { - if ( ! isset($Block) or isset($Block['type']) or isset($Block['interrupted'])) + if (empty($Block) or isset($Block['type']) or isset($Block['interrupted'])) { return; } @@ -850,9 +850,9 @@ protected function blockReference($Line) # # Table - protected function blockTable($Line, array $Block = null) + protected function blockTable($Line, array $Block = array()) { - if ( ! isset($Block) or isset($Block['type']) or isset($Block['interrupted'])) + if (empty($Block) or isset($Block['type']) or isset($Block['interrupted'])) { return; }