We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0cd6136 commit c912d6dCopy full SHA for c912d6d
lib/html/pipeline/sanitization_filter.rb
@@ -35,6 +35,7 @@ class SanitizationFilter < Filter
35
div ins del sup sub p ol ul table blockquote dl dt dd
36
kbd q samp var hr ruby rt rp li tr td th
37
),
38
+ :remove_contents => ['script'],
39
:attributes => {
40
'a' => ['href'],
41
'img' => ['src'],
test/html/pipeline/sanitization_filter_test.rb
@@ -44,4 +44,9 @@ def test_github_specific_protocols_are_not_removed
44
stuff = '<a href="github-windows://spillthelog">Spill this yo</a> and so on'
45
assert_equal stuff, SanitizationFilter.call(stuff).to_s
46
end
47
+
48
+ def test_script_contents_are_removed
49
+ orig = '<script>JavaScript!</script>'
50
+ assert_equal "", SanitizationFilter.call(orig).to_s
51
+ end
52
0 commit comments