@@ -505,7 +505,13 @@ def test_uri_escaping_of_href_attr_in_a_tag_in_safe_list_sanitizer
505505
506506 text = safe_list_sanitize ( html )
507507
508- assert_equal %{<a href=\" examp<!--%22%20unsafeattr=foo()>-->le.com\" >test</a>} , text
508+ acceptable_results = [
509+ # nokogiri w/vendored+patched libxml2
510+ %{<a href="examp<!--%22%20unsafeattr=foo()>-->le.com">test</a>} ,
511+ # nokogiri w/ system libxml2
512+ %{<a href="examp<!--%22%20unsafeattr=foo()>-->le.com">test</a>} ,
513+ ]
514+ assert_includes ( acceptable_results , text )
509515 end
510516
511517 def test_uri_escaping_of_src_attr_in_a_tag_in_safe_list_sanitizer
@@ -515,7 +521,13 @@ def test_uri_escaping_of_src_attr_in_a_tag_in_safe_list_sanitizer
515521
516522 text = safe_list_sanitize ( html )
517523
518- assert_equal %{<a src=\" examp<!--%22%20unsafeattr=foo()>-->le.com\" >test</a>} , text
524+ acceptable_results = [
525+ # nokogiri w/vendored+patched libxml2
526+ %{<a src="examp<!--%22%20unsafeattr=foo()>-->le.com">test</a>} ,
527+ # nokogiri w/system libxml2
528+ %{<a src="examp<!--%22%20unsafeattr=foo()>-->le.com">test</a>} ,
529+ ]
530+ assert_includes ( acceptable_results , text )
519531 end
520532
521533 def test_uri_escaping_of_name_attr_in_a_tag_in_safe_list_sanitizer
@@ -525,7 +537,13 @@ def test_uri_escaping_of_name_attr_in_a_tag_in_safe_list_sanitizer
525537
526538 text = safe_list_sanitize ( html )
527539
528- assert_equal %{<a name=\" examp<!--%22%20unsafeattr=foo()>-->le.com\" >test</a>} , text
540+ acceptable_results = [
541+ # nokogiri w/vendored+patched libxml2
542+ %{<a name="examp<!--%22%20unsafeattr=foo()>-->le.com">test</a>} ,
543+ # nokogiri w/system libxml2
544+ %{<a name="examp<!--%22%20unsafeattr=foo()>-->le.com">test</a>} ,
545+ ]
546+ assert_includes ( acceptable_results , text )
529547 end
530548
531549 def test_uri_escaping_of_name_action_in_a_tag_in_safe_list_sanitizer
@@ -535,7 +553,13 @@ def test_uri_escaping_of_name_action_in_a_tag_in_safe_list_sanitizer
535553
536554 text = safe_list_sanitize ( html , attributes : [ 'action' ] )
537555
538- assert_equal %{<a action=\" examp<!--%22%20unsafeattr=foo()>-->le.com\" >test</a>} , text
556+ acceptable_results = [
557+ # nokogiri w/vendored+patched libxml2
558+ %{<a action="examp<!--%22%20unsafeattr=foo()>-->le.com">test</a>} ,
559+ # nokogiri w/system libxml2
560+ %{<a action="examp<!--%22%20unsafeattr=foo()>-->le.com">test</a>} ,
561+ ]
562+ assert_includes ( acceptable_results , text )
539563 end
540564
541565 def test_exclude_node_type_processing_instructions
0 commit comments