Skip to content

Commit

Permalink
test: update behavior of namespaces in HTML4
Browse files Browse the repository at this point in the history
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
  • Loading branch information
flavorjones committed Apr 11, 2023
1 parent 2cf4996 commit ac83e6e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/xml/test_node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1141,17 +1141,17 @@ 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("<o:p>foo</o:p>", node.to_html)
elsif Nokogiri.uses_libxml?(">= 2.9.12")
assert_empty(node.namespaces.keys)
assert_equal("<p>foo</p>", node.to_html)
elsif Nokogiri.uses_libxml?
assert_equal(1, node.namespaces.keys.size)
assert(node.namespaces.key?("xmlns:o"))
assert_nil(node.namespaces["xmlns:o"])
assert_equal("<p>foo</p>", node.to_html)
else # jruby
assert_empty(node.namespaces.keys)
assert_equal("<o:p>foo</o:p>", node.to_html)
end
end

Expand Down

0 comments on commit ac83e6e

Please # to comment.