GNOME Bugzilla – Bug 795390
HTML parsing gets confused inside a <script> tag with nested <elements>
Last modified: 2021-07-05 13:22:46 UTC
To reproduce the bug, write these lines to the file lintMe.html: <script> let buttonDelete = $(`<a class="icon icon-del" href="#"></a>`); </script> Now lint them with libxml2-2.9.8: ./xmllint --html lintMe.html lintMe.html:2: HTML parser error : Unexpected end tag : a let buttonDelete = $(`<a class="icon icon-del" href="#"></a>`); ^ The parser scanned the JavaScript strings as if they were HTML elements, but did not recognize that they were at least balanced. While this bug is not earth-shattering, it is indeed preventing me from using Nokogiri to write a Ruby assertion, assert_html, that verifies a string contains valid HTML.
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/libxml2/-/issues/ Thank you for your understanding and your help.