We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a30a758 commit 8614ec5Copy full SHA for 8614ec5
src/Providers/Html.php
@@ -309,7 +309,7 @@ protected static function getMainElement(\DOMDocument $html)
309
}
310
311
312
- // Returns <body>
313
- return $html->getElementsByTagName('body')->item(0);
+ // Returns <body> or <html>
+ return $html->getElementsByTagName('body')->item(0) ?: $html->getElementsByTagName('html')->item(0);
314
315
0 commit comments