Skip to content

Commit

Permalink
Fix failing unit test
Browse files Browse the repository at this point in the history
One of the changes in released in Loofah 2.9.0 broke this test. I can't
tell if this was an intended or unintended side effect of the change to
support functions in shorthand CSS rule.

I'm not sure how well documented this change was, but Loofah's tests
were updated to reflect a different formatting in the commit that causes
this behavior. I think it's safe to say that stripping the whitespace
from rules like the one in this test is the expected behavior.

The test should be updated to reflect the new formatting.

Relevant links from Loofah:
https://github.com/flavorjones/loofah/releases/tag/v2.9.0
flavorjones/loofah#200
  • Loading branch information
jacobherrington committed Apr 7, 2021
1 parent 1e64885 commit dbff002
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/sanitizer_test.rb
Expand Up @@ -271,7 +271,7 @@ def test_should_allow_custom_tags_with_custom_attributes

def test_scrub_style_if_style_attribute_option_is_passed
input = '<p style="color: #000; background-image: url(http://www.ragingplatypus.com/i/cam-full.jpg);"></p>'
assert_equal '<p style="color: #000;"></p>', safe_list_sanitize(input, attributes: %w(style))
assert_equal '<p style="color:#000;"></p>', safe_list_sanitize(input, attributes: %w(style))
end

def test_should_raise_argument_error_if_tags_is_not_enumerable
Expand Down

0 comments on commit dbff002

Please sign in to comment.