Skip to content

Commit 4a6361c

Browse files
author
Juanito Fatas
committed
Fix build
Update test behavior for Nokogiri > 1.9.1. Drop support for Ruby 2.2.
1 parent 7d30b71 commit 4a6361c

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ sudo: false
33
cache: bundler
44
before_install: gem update bundler --no-document
55
rvm:
6-
- 2.2
76
- 2.3
87
- 2.4
98
- 2.5

Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ source 'https://rubygems.org'
33
# Specify your gem's dependencies in html-sanitizer.gemspec
44
gemspec
55

6-
gem "nokogiri", RUBY_VERSION < "2.1" ? "~> 1.6.0" : ">= 1.7"
7-
gem "activesupport", RUBY_VERSION < "2.2.2" ? "~> 4.2.0" : ">= 5"
6+
gem "nokogiri", ">= 1.10.0"
7+
gem "activesupport", ">= 5"

test/sanitizer_test.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -489,31 +489,31 @@ def test_uri_escaping_of_href_attr_in_a_tag_in_white_list_sanitizer
489489

490490
text = white_list_sanitize(html)
491491

492-
assert_equal %{<a href="examp<!--%22%20unsafeattr=foo()>-->le.com">test</a>}, text
492+
assert_equal %{<a href=\"examp&lt;!--%22%20unsafeattr=foo()&gt;--&gt;le.com\">test</a>}, text
493493
end
494494

495495
def test_uri_escaping_of_src_attr_in_a_tag_in_white_list_sanitizer
496496
html = %{<a src='examp<!--" unsafeattr=foo()>-->le.com'>test</a>}
497497

498498
text = white_list_sanitize(html)
499499

500-
assert_equal %{<a src="examp<!--%22%20unsafeattr=foo()>-->le.com">test</a>}, text
500+
assert_equal %{<a src=\"examp&lt;!--%22%20unsafeattr=foo()&gt;--&gt;le.com\">test</a>}, text
501501
end
502502

503503
def test_uri_escaping_of_name_attr_in_a_tag_in_white_list_sanitizer
504504
html = %{<a name='examp<!--" unsafeattr=foo()>-->le.com'>test</a>}
505505

506506
text = white_list_sanitize(html)
507507

508-
assert_equal %{<a name="examp<!--%22%20unsafeattr=foo()>-->le.com">test</a>}, text
508+
assert_equal %{<a name=\"examp&lt;!--%22%20unsafeattr=foo()&gt;--&gt;le.com\">test</a>}, text
509509
end
510510

511511
def test_uri_escaping_of_name_action_in_a_tag_in_white_list_sanitizer
512512
html = %{<a action='examp<!--" unsafeattr=foo()>-->le.com'>test</a>}
513513

514514
text = white_list_sanitize(html, attributes: ['action'])
515515

516-
assert_equal %{<a action="examp<!--%22%20unsafeattr=foo()>-->le.com">test</a>}, text
516+
assert_equal %{<a action=\"examp&lt;!--%22%20unsafeattr=foo()&gt;--&gt;le.com\">test</a>}, text
517517
end
518518

519519
protected

0 commit comments

Comments
 (0)