test/test_clean_comment.rb in sanitize-4.6.6 vs test/test_clean_comment.rb in sanitize-5.0.0
- old
+ new
@@ -18,11 +18,11 @@
@s.fragment("foo <!-- <!-- <!-- --> --> -->bar").must_equal 'foo --> -->bar'
@s.fragment("foo <div <!-- comment -->>bar</div>").must_equal 'foo <div>>bar</div>'
# Special case: the comment markup is inside a <script>, which makes it
# text content and not an actual HTML comment.
- @s.fragment("<script><!-- comment --></script>").must_equal '<!-- comment -->'
+ @s.fragment("<script><!-- comment --></script>").must_equal ''
Sanitize.fragment("<script><!-- comment --></script>", :allow_comments => false, :elements => ['script'])
.must_equal '<script><!-- comment --></script>'
end
end
@@ -37,13 +37,9 @@
@s.fragment('foo <!-- ').must_equal 'foo <!-- -->'
@s.fragment('foo <!-- - -> bar').must_equal 'foo <!-- - -> bar-->'
@s.fragment("foo <!--\n\n\n\n-->bar").must_equal "foo <!--\n\n\n\n-->bar"
@s.fragment("foo <!-- <!-- <!-- --> --> -->bar").must_equal 'foo <!-- <!-- <!-- --> --> -->bar'
@s.fragment("foo <div <!-- comment -->>bar</div>").must_equal 'foo <div>>bar</div>'
-
- # Special case: the comment markup is inside a <script>, which makes it
- # text content and not an actual HTML comment.
- @s.fragment("<script><!-- comment --></script>").must_equal '<!-- comment -->'
Sanitize.fragment("<script><!-- comment --></script>", :allow_comments => true, :elements => ['script'])
.must_equal '<script><!-- comment --></script>'
end
end