From bdddbeacd64f505ffae2f8093ffcfeff8bcc5290 Mon Sep 17 00:00:00 2001 From: "J. King" Date: Tue, 9 Mar 2021 18:44:08 -0500 Subject: [PATCH] Fix adoption agency --- lib/TreeBuilder.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/TreeBuilder.php b/lib/TreeBuilder.php index 8cacfff..6c76ce2 100644 --- a/lib/TreeBuilder.php +++ b/lib/TreeBuilder.php @@ -3512,8 +3512,8 @@ class TreeBuilder { $element = $this->createElementForToken($formattingToken, null, $furthestBlock); # Take all of the child nodes of furthest block and append them to # the element created in the last step. - foreach ($furthestBlock->childNodes as $node) { - $element->appendChild($node); + while ($furthestBlock->hasChildNodes()) { + $element->appendChild($furthestBlock->firstChild); } # Append that new element to furthest block. $furthestBlock->appendChild($element);