Class: Bolognese::WhitelistScrubber
- Inherits:
-
Loofah::Scrubber
- Object
- Loofah::Scrubber
- Bolognese::WhitelistScrubber
- Defined in:
- lib/bolognese/whitelist_scrubber.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ WhitelistScrubber
constructor
A new instance of WhitelistScrubber.
- #scrub(node) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ WhitelistScrubber
Returns a new instance of WhitelistScrubber.
7 8 9 10 11 |
# File 'lib/bolognese/whitelist_scrubber.rb', line 7 def initialize(={}) @direction = :bottom_up @tags = [:tags] @attributes = [:attributes] end |
Instance Method Details
#scrub(node) ⇒ Object
13 14 15 16 17 |
# File 'lib/bolognese/whitelist_scrubber.rb', line 13 def scrub(node) scrub_node_attributes(node) and return CONTINUE if node_allowed?(node) node.before node.children node.remove end |