domcleal / sclo-ror42

Ruby on Rails 4.2 software collection
0 stars 0 forks source link

EL6 nokogiri doesn't strip whitespace in sanitizer #3

Open domcleal opened 8 years ago

domcleal commented 8 years ago

rails-html-sanitizer tests fail on EL6 with:

  1) Failure:
SanitizersTest#test_strip_tags_multiline [/builddir/build/BUILD/rails-html-sanitizer-1.0.2/opt/rh/sclo-ror42/root/usr/share/gems/gems/rails-html-sanitizer-1.0.2/test/sanitizer_test.rb:64]:
--- expected
+++ actual
@@ -1,6 +1 @@
-"This is a test.
-
-
-
-It no longer contains any HTML.
-"
+"This is a test.It no longer contains any HTML."
  2) Failure:
SanitizersTest#test_strip_blank_string [/builddir/build/BUILD/rails-html-sanitizer-1.0.2/opt/rh/sclo-ror42/root/usr/share/gems/gems/rails-html-sanitizer-1.0.2/test/sanitizer_test.rb:80]:
Expected: "   "
  Actual: ""

Also nokogiri tests (which are ignored) fail with:

  2) Failure:
Nokogiri::HTML::TestDocumentFragment#test_html_fragment_with_input_and_intermediate_whitespace [/builddir/build/BUILD/rubygem-nokogiri-1.6.7.rc3/opt/rh/sclo-ror42/root/usr/share/gems/gems/nokogiri-1.6.7.rc3/test/html/test_document_fragment.rb:170]:
--- expected
+++ actual
@@ -1 +1 @@
-" span"
+"span"

which looks related.

The html-sanitizer source says it's entirely reliant upon nokogiri and the underlying XML parser, which is probably libxml2, so could be a base OS bug or something.

domcleal commented 8 years ago

Perhaps the same bug in actionview's tests on EL6:

  7   1) Failure:
  6 TextHelperTest#test_highlight_pending [/builddir/build/BUILD/rubygem-actionview-4.2.5/opt/rh/sclo-ror42/root/usr/share/gems/gems/actionview-4.2.5/test/template/text_helper_test.rb:193]:
  5 Expected: "   "
  4   Actual: ""
  3 1553 runs, 3526 assertions, 1 failures, 0 errors, 1 skips