Issue #3204929 by longwave, donquixote, andypost: Html::load() inconsistent space removal with old libxml2 versions

(cherry picked from commit d8d13be9c8)
merge-requests/1315/head
catch 2022-07-21 21:38:17 +09:00
parent c254f1351b
commit 9a0749262a
3 changed files with 3 additions and 2 deletions

View File

@ -286,7 +286,7 @@ EOD;
$dom = new \DOMDocument(); $dom = new \DOMDocument();
// Ignore warnings during HTML soup loading. // Ignore warnings during HTML soup loading.
@$dom->loadHTML($document); @$dom->loadHTML($document, LIBXML_NOBLANKS);
return $dom; return $dom;
} }

View File

@ -886,6 +886,7 @@ nmsgstr
nntp nntp
noaccess noaccess
noadd noadd
noblanks
nocache nocache
nocase nocase
nocdata nocdata

View File

@ -125,7 +125,7 @@ trait AssertContentTrait {
// DOM can load HTML soup. But, HTML soup can throw warnings, suppress // DOM can load HTML soup. But, HTML soup can throw warnings, suppress
// them. // them.
$html_dom = new \DOMDocument(); $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) { if ($html_dom) {
// It's much easier to work with simplexml than DOM, luckily enough // It's much easier to work with simplexml than DOM, luckily enough
// we can just simply import our DOM tree. // we can just simply import our DOM tree.