diff --git a/lib/html/pipeline/sanitization_filter.rb b/lib/html/pipeline/sanitization_filter.rb index 6d463e9f..0cb8fa21 100644 --- a/lib/html/pipeline/sanitization_filter.rb +++ b/lib/html/pipeline/sanitization_filter.rb @@ -33,7 +33,7 @@ class SanitizationFilter < Filter TABLE_SECTIONS = Set.new(%w[thead tbody tfoot].freeze) # These schemes are the only ones allowed in attributes by default. - ANCHOR_SCHEMES = ['http', 'https', 'mailto', :relative, 'github-windows', 'github-mac'].freeze + ANCHOR_SCHEMES = ['http', 'https', 'mailto', :relative, 'github-windows', 'github-mac', 'irc', 'ircs'].freeze # The main sanitization whitelist. Only these elements and attributes are # allowed through by default. diff --git a/test/html/pipeline/sanitization_filter_test.rb b/test/html/pipeline/sanitization_filter_test.rb index dbd53f70..6ef403f3 100644 --- a/test/html/pipeline/sanitization_filter_test.rb +++ b/test/html/pipeline/sanitization_filter_test.rb @@ -102,7 +102,7 @@ def test_uses_anchor_schemes_from_whitelist_when_not_separately_specified end def test_whitelist_contains_default_anchor_schemes - assert_equal SanitizationFilter::WHITELIST[:protocols]['a']['href'], ['http', 'https', 'mailto', :relative, 'github-windows', 'github-mac'] + assert_equal SanitizationFilter::WHITELIST[:protocols]['a']['href'], ['http', 'https', 'mailto', :relative, 'github-windows', 'github-mac', 'irc', 'ircs'] end def test_whitelist_from_full_constant @@ -113,7 +113,7 @@ def test_whitelist_from_full_constant end def test_exports_default_anchor_schemes - assert_equal SanitizationFilter::ANCHOR_SCHEMES, ['http', 'https', 'mailto', :relative, 'github-windows', 'github-mac'] + assert_equal SanitizationFilter::ANCHOR_SCHEMES, ['http', 'https', 'mailto', :relative, 'github-windows', 'github-mac', 'irc', 'ircs'] end def test_script_contents_are_removed