Skip to content

Commit 7dbd2ad

Browse files
committed
When outputting a TEXT_RAW node, make sure each child is an instance of DOMCharacterData
1 parent 9da7ec0 commit 7dbd2ad

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/HTML5/Serializer/OutputRules.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,9 @@ public function element($ele)
221221
$this->openTag($ele);
222222
if (Elements::isA($name, Elements::TEXT_RAW)) {
223223
foreach ($ele->childNodes as $child) {
224-
$this->wr($child->data);
224+
if ($child instanceof \DOMCharacterData) {
225+
$this->wr($child->data);
226+
}
225227
}
226228
} else {
227229
// Handle children.

0 commit comments

Comments
 (0)