summaryrefslogtreecommitdiff
path: root/spec/lib/banzai/filter
diff options
context:
space:
mode:
authorJames <git@jamedjo.co.uk>2016-09-28 12:46:11 +0100
committerJames Edwards-Jones <jedwardsjones@gitlab.com>2017-03-06 16:27:49 +0000
commit00f5cb84d55036542165c756e235619631bc7dee (patch)
treed2124a1ebb272019ed44351363eed0d9d06c971e /spec/lib/banzai/filter
parent0a58a8c8258d26e7f5c782ca1cce8665d230fa83 (diff)
downloadgitlab-ce-00f5cb84d55036542165c756e235619631bc7dee.tar.gz
SanitizationFilter allows html5 details and summary (Issue #21605)
Also adds details/summary tags to Copy-as-GFM
Diffstat (limited to 'spec/lib/banzai/filter')
-rw-r--r--spec/lib/banzai/filter/sanitization_filter_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/lib/banzai/filter/sanitization_filter_spec.rb b/spec/lib/banzai/filter/sanitization_filter_spec.rb
index b38e3b17e64..b4cd5f63a15 100644
--- a/spec/lib/banzai/filter/sanitization_filter_spec.rb
+++ b/spec/lib/banzai/filter/sanitization_filter_spec.rb
@@ -86,6 +86,16 @@ describe Banzai::Filter::SanitizationFilter, lib: true do
expect(filter(act).to_html).to eq exp
end
+ it 'allows `summary` elements' do
+ exp = act = '<summary>summary line</summary>'
+ expect(filter(act).to_html).to eq exp
+ end
+
+ it 'allows `details` elements' do
+ exp = act = '<details>long text goes here</details>'
+ expect(filter(act).to_html).to eq exp
+ end
+
it 'removes `rel` attribute from `a` elements' do
act = %q{<a href="#" rel="nofollow">Link</a>}
exp = %q{<a href="#">Link</a>}