Skip to content

Commit fa76a8b

Browse files
itamargivlucaswerkmeister
authored andcommitted
Add LIBXML_NOBLANKS option
1 parent 2630c95 commit fa76a8b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Component.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ private function parseHtml( $html ) {
7272
$document = new DOMDocument( '1.0', 'UTF-8' );
7373

7474
// Ensure $html is treated as UTF-8, see https://stackoverflow.com/a/8218649
75-
if ( !$document->loadHTML( '<?xml encoding="utf-8" ?>' . $html ) ) {
75+
// LIBXML_NOBLANKS Constant excludes "ghost nodes" to avoid violating
76+
// vue's single root node constraint
77+
if ( !$document->loadHTML( '<?xml encoding="utf-8" ?>' . $html, LIBXML_NOBLANKS ) ) {
7678
//TODO Test failure
7779
}
7880

0 commit comments

Comments
 (0)