From e54322f1bbe5d83253dc7db686ca6f8d0dd60755 Mon Sep 17 00:00:00 2001 From: Julian Hundeloh Date: Tue, 10 May 2022 14:02:37 +0200 Subject: [PATCH 1/2] fix: allow text nodes in descendants --- src/Editor.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Editor.php b/src/Editor.php index 7e5f879b6..7dc972c23 100644 --- a/src/Editor.php +++ b/src/Editor.php @@ -126,11 +126,6 @@ public function descendants($closure): Editor */ private function walkThroughNodes(&$node, $closure) { - // Skip, if it’s just text. - if ($node->type === 'text') { - return; - } - // Call the closure. $closure($node); From 8fea6b844c16243739128cf0aa1ca3341ba9c730 Mon Sep 17 00:00:00 2001 From: Julian Hundeloh Date: Tue, 10 May 2022 12:06:16 +0000 Subject: [PATCH 2/2] test: update test --- tests/Editor/DescendantsTest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/Editor/DescendantsTest.php b/tests/Editor/DescendantsTest.php index facc755ac..a34ab8271 100644 --- a/tests/Editor/DescendantsTest.php +++ b/tests/Editor/DescendantsTest.php @@ -73,9 +73,13 @@ 'bulletList', 'listItem', 'paragraph', + 'text', 'listItem', 'paragraph', + 'text', + 'text', 'paragraph', + 'text', ]); });