Skip to content

Commit ef6ef3d

Browse files
committed
Test that links with unknown schemes are removed
1 parent ee8724c commit ef6ef3d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/html/pipeline/sanitization_filter_test.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ def test_github_specific_protocols_are_not_removed
4545
assert_equal stuff, SanitizationFilter.call(stuff).to_s
4646
end
4747

48+
def test_unknown_schemes_are_removed
49+
stuff = '<a href="something-weird://heyyy">Wat</a> is this'
50+
html = SanitizationFilter.call(stuff).to_s
51+
assert_equal '<a>Wat</a> is this', html
52+
end
53+
4854
def test_script_contents_are_removed
4955
orig = '<script>JavaScript!</script>'
5056
assert_equal "", SanitizationFilter.call(orig).to_s

0 commit comments

Comments
 (0)