Skip to content

Commit ac83e6e

Browse files
committed
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
1 parent 2cf4996 commit ac83e6e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/xml/test_node.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,17 +1141,17 @@ def test_namespace_without_an_href_on_html_node
11411141
node = html.at("div").children.first
11421142
refute_nil(node)
11431143

1144-
if Nokogiri.uses_libxml?(">= 2.9.12")
1144+
if Nokogiri.uses_libxml?(">= 2.11.0") || Nokogiri.jruby?
1145+
assert_empty(node.namespaces.keys)
1146+
assert_equal("<o:p>foo</o:p>", node.to_html)
1147+
elsif Nokogiri.uses_libxml?(">= 2.9.12")
11451148
assert_empty(node.namespaces.keys)
11461149
assert_equal("<p>foo</p>", node.to_html)
11471150
elsif Nokogiri.uses_libxml?
11481151
assert_equal(1, node.namespaces.keys.size)
11491152
assert(node.namespaces.key?("xmlns:o"))
11501153
assert_nil(node.namespaces["xmlns:o"])
11511154
assert_equal("<p>foo</p>", node.to_html)
1152-
else # jruby
1153-
assert_empty(node.namespaces.keys)
1154-
assert_equal("<o:p>foo</o:p>", node.to_html)
11551155
end
11561156
end
11571157

0 commit comments

Comments
 (0)