Skip to content

Commit

Permalink
Merge pull request #264 from flavorjones/flavorjones-support-libxml-2…
Browse files Browse the repository at this point in the history
….10.4

test: support libxml 2.10.4 behavior around namespaces
  • Loading branch information
flavorjones authored Apr 11, 2023
2 parents 4e55b64 + d7efe5e commit 5f7efdb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions test/integration/test_ad_hoc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
"<p>Foo <b>BOLD</b></p>"
elsif Nokogiri.jruby?
"<p>Foo <b>BOLD<o:p></o:p></b></p>"
Expand All @@ -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
"<p>Foo <b>BOLD</b></p>"
elsif Nokogiri.jruby?
"<p>Foo <b>BOLD<o:p></o:p></b></p>"
Expand Down
4 changes: 2 additions & 2 deletions test/integration/test_scrubbers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def html5?
doc = klass.parse("<html><body>#{WHITEWASH_FRAGMENT}</body></html>")
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
Expand Down Expand Up @@ -358,7 +358,7 @@ def html5?
doc = klass.parse("<div>#{WHITEWASH_FRAGMENT}</div>")
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
Expand Down

0 comments on commit 5f7efdb

Please sign in to comment.