<?php namespace BookStack\Util;
use DOMDocument;
-use DOMNode;
use DOMNodeList;
use DOMXPath;
return $html;
}
+ $html = '<body>' . $html . '</body>';
libxml_use_internal_errors(true);
$doc = new DOMDocument();
$doc->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8'));
/**
* Removed all of the given DOMNodes.
*/
- static protected function removeNodes(DOMNodeList $nodes): void
+ protected static function removeNodes(DOMNodeList $nodes): void
{
foreach ($nodes as $node) {
$node->parentNode->removeChild($node);
}
}
-
-}
\ No newline at end of file
+}