diff --git a/core/lib/Drupal/Component/Utility/Html.php b/core/lib/Drupal/Component/Utility/Html.php
index f9bb8e6a23..8c7d3888cd 100644
--- a/core/lib/Drupal/Component/Utility/Html.php
+++ b/core/lib/Drupal/Component/Utility/Html.php
@@ -286,7 +286,7 @@ public static function load($html) {
 
     $dom = new \DOMDocument();
     // Ignore warnings during HTML soup loading.
-    @$dom->loadHTML($document);
+    @$dom->loadHTML($document, LIBXML_NOBLANKS);
 
     return $dom;
   }
diff --git a/core/misc/cspell/dictionary.txt b/core/misc/cspell/dictionary.txt
index 6b8c9fe60e..b141ad61b6 100644
--- a/core/misc/cspell/dictionary.txt
+++ b/core/misc/cspell/dictionary.txt
@@ -870,6 +870,7 @@ nmsgstr
 nntp
 noaccess
 noadd
+noblanks
 nocache
 nocase
 nocdata
