From d7efe5ef5535e64b42e58be4585c38c4b196170a Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Tue, 11 Apr 2023 11:26:45 -0400 Subject: [PATCH] test: support libxml 2.10.4 behavior around namespaces see note in https://gitlab.gnome.org/GNOME/libxml2/-/releases/v2.10.4 --- test/integration/test_ad_hoc.rb | 4 ++-- test/integration/test_scrubbers.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/integration/test_ad_hoc.rb b/test/integration/test_ad_hoc.rb index 8d24f96..a0caf04 100644 --- a/test/integration/test_ad_hoc.rb +++ b/test/integration/test_ad_hoc.rb @@ -130,7 +130,7 @@ def test_whitewash_on_fragment def test_fragment_whitewash_on_microsofty_markup whitewashed = fragment(MSWORD_HTML).scrub!(:whitewash) - expected = if Nokogiri.uses_libxml?("<2.9.11") || html_version == :html5 + expected = if Nokogiri.uses_libxml?("<2.9.11") || Nokogiri.uses_libxml?(">=2.10.4") || html_version == :html5 "

Foo BOLD

" elsif Nokogiri.jruby? "

Foo BOLD

" @@ -143,7 +143,7 @@ def test_fragment_whitewash_on_microsofty_markup def test_document_whitewash_on_microsofty_markup whitewashed = document(MSWORD_HTML).scrub!(:whitewash) - expected = if Nokogiri.uses_libxml?("<2.9.11") || html_version == :html5 + expected = if Nokogiri.uses_libxml?("<2.9.11") || Nokogiri.uses_libxml?(">=2.10.4") || html_version == :html5 "

Foo BOLD

" elsif Nokogiri.jruby? "

Foo BOLD

" diff --git a/test/integration/test_scrubbers.rb b/test/integration/test_scrubbers.rb index 93d7f06..b1dc67d 100644 --- a/test/integration/test_scrubbers.rb +++ b/test/integration/test_scrubbers.rb @@ -159,7 +159,7 @@ def html5? doc = klass.parse("#{WHITEWASH_FRAGMENT}") result = doc.scrub!(:whitewash) - ww_result = if Nokogiri.uses_libxml?("<2.9.11") || html5? + ww_result = if Nokogiri.uses_libxml?("<2.9.11") || Nokogiri.uses_libxml?(">=2.10.4") || html5? WHITEWASH_RESULT elsif Nokogiri.jruby? WHITEWASH_RESULT_JRUBY @@ -358,7 +358,7 @@ def html5? doc = klass.parse("
#{WHITEWASH_FRAGMENT}
") result = doc.scrub!(:whitewash) - ww_result = if Nokogiri.uses_libxml?("<2.9.11") || html5? + ww_result = if Nokogiri.uses_libxml?("<2.9.11") || Nokogiri.uses_libxml?(">=2.10.4") || html5? WHITEWASH_RESULT elsif Nokogiri.jruby? WHITEWASH_RESULT_JRUBY