@@ -485,35 +485,43 @@ def test_allow_data_attribute_if_requested
485485 end
486486
487487 def test_uri_escaping_of_href_attr_in_a_tag_in_white_list_sanitizer
488+ skip if RUBY_VERSION < "2.3"
489+
488490 html = %{<a href='examp<!--" unsafeattr=foo()>-->le.com'>test</a>}
489491
490492 text = white_list_sanitize ( html )
491493
492- assert_equal %{<a href="examp< !--%22%20unsafeattr=foo()>--> le.com">test</a>} , text
494+ assert_equal %{<a href=\ " examp< !--%22%20unsafeattr=foo()>--> le.com\ " >test</a>} , text
493495 end
494496
495497 def test_uri_escaping_of_src_attr_in_a_tag_in_white_list_sanitizer
498+ skip if RUBY_VERSION < "2.3"
499+
496500 html = %{<a src='examp<!--" unsafeattr=foo()>-->le.com'>test</a>}
497501
498502 text = white_list_sanitize ( html )
499503
500- assert_equal %{<a src="examp< !--%22%20unsafeattr=foo()>--> le.com">test</a>} , text
504+ assert_equal %{<a src=\ " examp< !--%22%20unsafeattr=foo()>--> le.com\ " >test</a>} , text
501505 end
502506
503507 def test_uri_escaping_of_name_attr_in_a_tag_in_white_list_sanitizer
508+ skip if RUBY_VERSION < "2.3"
509+
504510 html = %{<a name='examp<!--" unsafeattr=foo()>-->le.com'>test</a>}
505511
506512 text = white_list_sanitize ( html )
507513
508- assert_equal %{<a name="examp< !--%22%20unsafeattr=foo()>--> le.com">test</a>} , text
514+ assert_equal %{<a name=\ " examp< !--%22%20unsafeattr=foo()>--> le.com\ " >test</a>} , text
509515 end
510516
511517 def test_uri_escaping_of_name_action_in_a_tag_in_white_list_sanitizer
518+ skip if RUBY_VERSION < "2.3"
519+
512520 html = %{<a action='examp<!--" unsafeattr=foo()>-->le.com'>test</a>}
513521
514522 text = white_list_sanitize ( html , attributes : [ 'action' ] )
515523
516- assert_equal %{<a action="examp< !--%22%20unsafeattr=foo()>--> le.com">test</a>} , text
524+ assert_equal %{<a action=\ " examp< !--%22%20unsafeattr=foo()>--> le.com\ " >test</a>} , text
517525 end
518526
519527protected
0 commit comments