class Rails::Html::TargetScrubber
Rails::Html::TargetScrubber¶ ↑
Where Rails::Html::PermitScrubber picks out tags and attributes to permit in sanitization, Rails::Html::TargetScrubber targets them for removal.
tags=
If set, elements included will be stripped.
attributes=
If set, attributes included will be removed.
Public Instance Methods
allowed_node?(node)
click to toggle source
# File lib/rails/html/scrubbers.rb, line 139 def allowed_node?(node) !@tags.include?(node.name) end
scrub_attribute?(name)
click to toggle source
# File lib/rails/html/scrubbers.rb, line 143 def scrub_attribute?(name) @attributes.include?(name) end