diff --git a/Parsedown.php b/Parsedown.php index c47c673..a3cb151 100755 --- a/Parsedown.php +++ b/Parsedown.php @@ -1632,8 +1632,6 @@ class Parsedown protected function elementApplyRecursive($closure, array $Element) { - $Element = call_user_func($closure, $Element); - if (isset($Element['elements'])) { $Element['elements'] = $this->elementsApplyRecursive($closure, $Element['elements']); @@ -1643,6 +1641,8 @@ class Parsedown $Element['element'] = $this->elementApplyRecursive($closure, $Element['element']); } + $Element = call_user_func($closure, $Element); + return $Element; }