Skip to content

Commit

Permalink
Whitelist the <abbr> tag
Browse files Browse the repository at this point in the history
  • Loading branch information
glebm committed Mar 29, 2017
1 parent 9ec1013 commit 2d29ef2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/thredded/content_formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class ContentFormatter
mattr_accessor :whitelist

self.whitelist = HTML::Pipeline::SanitizationFilter::WHITELIST.deep_merge(
elements: HTML::Pipeline::SanitizationFilter::WHITELIST[:elements] + %w(iframe span figure figcaption),
elements: HTML::Pipeline::SanitizationFilter::WHITELIST[:elements] + %w(abbr iframe span figure figcaption),
transformers: HTML::Pipeline::SanitizationFilter::WHITELIST[:transformers] + [
lambda do |env|
next unless env[:node_name] == 'a'
Expand All @@ -20,6 +20,7 @@ class ContentFormatter
],
attributes: {
'a' => %w(href rel),
'abbr' => %w(title),
'span' => %w(class),
'div' => %w(class)
}
Expand Down

0 comments on commit 2d29ef2

Please sign in to comment.