From 721a2ca361efc9a64a7a9df9766132ac2c10f5e8 Mon Sep 17 00:00:00 2001 From: ~keith Date: Wed, 31 Aug 2022 18:38:50 +0000 Subject: [PATCH] FUCKING empty() --- src/Content/Text/HTML.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Content/Text/HTML.php b/src/Content/Text/HTML.php index 2ce90faeb..1eeb7bbb4 100644 --- a/src/Content/Text/HTML.php +++ b/src/Content/Text/HTML.php @@ -114,7 +114,7 @@ class HTML /** @var \DOMNode $child */ foreach ($node->childNodes as $key => $child) { /* Remove empty text nodes at the start or at the end of the children list */ - if ($key > 0 && $key < $node->childNodes->length - 1 || $child->nodeName != '#text' || !empty(trim($child->nodeValue))) { + if ($key > 0 && $key < $node->childNodes->length - 1 || $child->nodeName != '#text' || trim($child->nodeValue) !== '') { $newNode = $child->cloneNode(true); $node->parentNode->insertBefore($newNode, $node); }