Skip to content

Commit

Permalink
Merge pull request #191 from frozencemetery/irc_urls
Browse files Browse the repository at this point in the history
Render irc and ircs URLs
  • Loading branch information
gjtorikian committed Nov 13, 2018
2 parents f48c733 + dad664a commit 1031d93
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/html/pipeline/sanitization_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class SanitizationFilter < Filter
TABLE_SECTIONS = Set.new(%w[thead tbody tfoot].freeze)

# These schemes are the only ones allowed in <a href> 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.
Expand Down
4 changes: 2 additions & 2 deletions test/html/pipeline/sanitization_filter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 1031d93

Please sign in to comment.