Skip to content

Commit 624d289

Browse files
committed
Adapt to php-html-parse changes to options and load method
1 parent 32bfd55 commit 624d289

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Inky.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
use PHPHtmlParser\Dom\Node\HtmlNode;
3636
use PHPHtmlParser\Dom\Node\InnerNode;
3737
use PHPHtmlParser\Exceptions\CircularException;
38+
use PHPHtmlParser\Options;
3839

3940
class Inky
4041
{
@@ -184,11 +185,10 @@ protected function getAllComponentFactories()
184185
public function releaseTheKraken($html)
185186
{
186187
$dom = new Dom();
187-
$dom->setOptions([
188-
'removeStyles' => false,
189-
'removeScripts' => false,
190-
]);
191-
$dom->load((string) $html);
188+
$dom->setOptions(
189+
(new Options())->setRemoveScripts(false)->setRemoveStyles(false)
190+
);
191+
$dom->loadStr((string) $html);
192192

193193
$parseCounter = 0;
194194
while($this->parse($dom)) {
@@ -201,7 +201,7 @@ public function releaseTheKraken($html)
201201
return $dom->root->outerhtml;
202202
}
203203

204-
protected function clearCache(InnerNode $node)
204+
protected function clearCache(HtmlNode $node)
205205
{
206206
foreach($node->getChildren() as $child) {
207207
if($child instanceof AbstractNode) {

0 commit comments

Comments
 (0)