Issue #3204929 by longwave, donquixote, andypost: Html::load() inconsistent space removal with old libxml2 versions
(cherry picked from commit d8d13be9c8
)
merge-requests/1315/head
parent
c254f1351b
commit
9a0749262a
|
@ -286,7 +286,7 @@ EOD;
|
|||
|
||||
$dom = new \DOMDocument();
|
||||
// Ignore warnings during HTML soup loading.
|
||||
@$dom->loadHTML($document);
|
||||
@$dom->loadHTML($document, LIBXML_NOBLANKS);
|
||||
|
||||
return $dom;
|
||||
}
|
||||
|
|
|
@ -886,6 +886,7 @@ nmsgstr
|
|||
nntp
|
||||
noaccess
|
||||
noadd
|
||||
noblanks
|
||||
nocache
|
||||
nocase
|
||||
nocdata
|
||||
|
|
|
@ -125,7 +125,7 @@ trait AssertContentTrait {
|
|||
// DOM can load HTML soup. But, HTML soup can throw warnings, suppress
|
||||
// them.
|
||||
$html_dom = new \DOMDocument();
|
||||
@$html_dom->loadHTML('<?xml encoding="UTF-8">' . $this->getRawContent());
|
||||
@$html_dom->loadHTML('<?xml encoding="UTF-8">' . $this->getRawContent(), LIBXML_NOBLANKS);
|
||||
if ($html_dom) {
|
||||
// It's much easier to work with simplexml than DOM, luckily enough
|
||||
// we can just simply import our DOM tree.
|
||||
|
|
Loading…
Reference in New Issue