Fix unit tests
This commit is contained in:
parent
b54200e5d8
commit
5bc9250ccc
@ -70,6 +70,9 @@ class Html
|
|||||||
$html = '<body>' . $html . '</body>';
|
$html = '<body>' . $html . '</body>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//need to remove whitespaces between tags, as loadHTML seems to take those into account
|
||||||
|
$html = preg_replace('/(\>)\s*(\<)/m', '$1$2', $html);
|
||||||
|
|
||||||
// Load DOM
|
// Load DOM
|
||||||
libxml_disable_entity_loader(true);
|
libxml_disable_entity_loader(true);
|
||||||
$dom = new \DOMDocument();
|
$dom = new \DOMDocument();
|
||||||
@ -77,6 +80,7 @@ class Html
|
|||||||
$dom->loadHTML($html, LIBXML_NOWARNING);
|
$dom->loadHTML($html, LIBXML_NOWARNING);
|
||||||
self::$xpath = new \DOMXPath($dom);
|
self::$xpath = new \DOMXPath($dom);
|
||||||
$node = $dom->getElementsByTagName('body');
|
$node = $dom->getElementsByTagName('body');
|
||||||
|
|
||||||
self::parseNode($node->item(0), $element);
|
self::parseNode($node->item(0), $element);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user