Problem/Motivation
libxml2 prior to 2.9.0 removed blank elements (whitespace) when parsing HTML. This behaviour was reverted in later versions of libxml2 in https://gitlab.gnome.org/GNOME/libxml2/-/commit/f933c898132f20a50ba39ac6...
In #3204929: Html::load() inconsistent space removal with old libxml2 versions. we added LIBXML_NOBLANKS
to DOMDocument::loadHTML()
calls to preserve compatibility with the previous behaviour, so our tests pass the same way on both the old and new versions.
We should decide whether stripping whitespace is the right thing to do, or whether we should now preserve whitespace and update our tests to match the new behaviour.