From ac83e6ee7011ce9fec24399c759a73fb924a0de6 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Fri, 31 Mar 2023 17:41:03 -0400 Subject: [PATCH] test: update behavior of namespaces in HTML4 libxml 2.11.0 fixes the parser to ignore the namespaces as a namespace, but not to split the QName (see upstream commit d7d0bc65). Fixes #2836 --- test/xml/test_node.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/xml/test_node.rb b/test/xml/test_node.rb index 80fb66d37b..137c46d61b 100644 --- a/test/xml/test_node.rb +++ b/test/xml/test_node.rb @@ -1141,7 +1141,10 @@ def test_namespace_without_an_href_on_html_node node = html.at("div").children.first refute_nil(node) - if Nokogiri.uses_libxml?(">= 2.9.12") + if Nokogiri.uses_libxml?(">= 2.11.0") || Nokogiri.jruby? + assert_empty(node.namespaces.keys) + assert_equal("foo", node.to_html) + elsif Nokogiri.uses_libxml?(">= 2.9.12") assert_empty(node.namespaces.keys) assert_equal("

foo

", node.to_html) elsif Nokogiri.uses_libxml? @@ -1149,9 +1152,6 @@ def test_namespace_without_an_href_on_html_node assert(node.namespaces.key?("xmlns:o")) assert_nil(node.namespaces["xmlns:o"]) assert_equal("

foo

", node.to_html) - else # jruby - assert_empty(node.namespaces.keys) - assert_equal("foo", node.to_html) end end