mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Merge pull request #603 from aidantwoods/fix/recursion
Apply depth first
This commit is contained in:
commit
8f3f61883d
@ -1632,8 +1632,6 @@ class Parsedown
|
|||||||
|
|
||||||
protected function elementApplyRecursive($closure, array $Element)
|
protected function elementApplyRecursive($closure, array $Element)
|
||||||
{
|
{
|
||||||
$Element = call_user_func($closure, $Element);
|
|
||||||
|
|
||||||
if (isset($Element['elements']))
|
if (isset($Element['elements']))
|
||||||
{
|
{
|
||||||
$Element['elements'] = $this->elementsApplyRecursive($closure, $Element['elements']);
|
$Element['elements'] = $this->elementsApplyRecursive($closure, $Element['elements']);
|
||||||
@ -1643,6 +1641,8 @@ class Parsedown
|
|||||||
$Element['element'] = $this->elementApplyRecursive($closure, $Element['element']);
|
$Element['element'] = $this->elementApplyRecursive($closure, $Element['element']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$Element = call_user_func($closure, $Element);
|
||||||
|
|
||||||
return $Element;
|
return $Element;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user