Skip to content

Commit 351e9c6

Browse files
author
Andrew Scott
committed
Allow html() and other methods that take string inputs to directly set text nodes as well as elements. Fixes #49.
1 parent 259b9fd commit 351e9c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Traits/ManipulationTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ protected function nodesFromHtml($html): NodeList {
109109
$class = get_class($this->document());
110110
$doc = new $class();
111111
$doc->setEncoding($this->document()->getEncoding());
112-
$nodes = $doc->html($html)->find('body > *');
112+
$nodes = $doc->html($html)->find('body')->contents();
113113

114114
return $nodes;
115115
}

0 commit comments

Comments
 (0)