From 81025cd468f4f51eebedd2c159be893bfa414602 Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Thu, 13 Oct 2016 19:25:43 +0200 Subject: [PATCH] Revert "Break less previously passed CommonMarkWeak tests" This reverts commit 2db31995104f9ad31b9b1a10f8cf2be9d7a32441. --- Parsedown.php | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/Parsedown.php b/Parsedown.php index 2ee8417..bb2bd11 100644 --- a/Parsedown.php +++ b/Parsedown.php @@ -188,34 +188,16 @@ class Parsedown # ~ - $highPriority = array(); - $blockTypes = $this->unmarkedBlockTypes; if (isset($this->BlockTypes[$marker])) { foreach ($this->BlockTypes[$marker] as $blockType) { - if - ( - isset($CurrentBlock['type']) - and $CurrentBlock['type'] === $blockType - and ! isset($CurrentBlock['interrupted']) - and isset($CurrentBlock['continuable']) - and ! isset($CurrentBlock['complete']) - ) - { - $highPriority[] = $CurrentBlock['type']; - } - else - { - $blockTypes []= $blockType; - } + $blockTypes []= $blockType; } } - $blockTypes = array_merge($highPriority, $blockTypes); - # # ~ @@ -607,6 +589,8 @@ class Parsedown return null; } + unset($placeholder); + if ($Line['text'][0] === '[' and $this->blockReference($Line)) { return $Block; @@ -614,7 +598,7 @@ class Parsedown if ( ! isset($Block['interrupted'])) { - $text = preg_replace('/^[ ]{0,'.min(4, $Block['indent']).'}/', '', $Line['body']); + $text = preg_replace('/^[ ]{0,'.min(4, $Block['indent'] + 1).'}/', '', $Line['body']); $Block['li']['text'] []= $text; @@ -625,12 +609,7 @@ class Parsedown { $Block['li']['text'] []= ''; - $text = preg_replace('/^[ ]{0,4}/', '', $Line['body']); - - if ($placeholder = $this->blockList($Line)) - { - $text = preg_replace('/^[ ]{0,'.min(4, $Block['indent']).'}/', '', $Line['body']); - } + $text = preg_replace('/^[ ]{0,'.min(4, $Block['indent'] + 1).'}/', '', $Line['body']); $Block['li']['text'] []= $text;