From 4f027386b145bf2c7c41a9d1957018a8bff171b8 Mon Sep 17 00:00:00 2001 From: Emanuil Rusev Date: Thu, 24 Apr 2014 23:52:42 +0300 Subject: [PATCH] "complete" calls should be more consistent --- Parsedown.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Parsedown.php b/Parsedown.php index e7f4f9e..ab9e49e 100755 --- a/Parsedown.php +++ b/Parsedown.php @@ -158,12 +158,12 @@ class Parsedown } else { - unset($CurrentBlock['incomplete']); - if (method_exists($this, 'complete'.$CurrentBlock['type'])) { $CurrentBlock = $this->{'complete'.$CurrentBlock['type']}($CurrentBlock); } + + unset($CurrentBlock['incomplete']); } } @@ -236,6 +236,15 @@ class Parsedown } } + # ~ + + if (isset($CurrentBlock['incomplete']) and method_exists($this, 'complete'.$CurrentBlock['type'])) + { + $CurrentBlock = $this->{'complete'.$CurrentBlock['type']}($CurrentBlock); + } + + # ~ + $elements []= $CurrentBlock['element']; unset($elements[0]);