Class: Bolognese::WhitelistScrubber

Inherits:
Loofah::Scrubber
  • Object
show all
Defined in:
lib/bolognese/whitelist_scrubber.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ WhitelistScrubber

Returns a new instance of WhitelistScrubber.



5
6
7
8
9
# File 'lib/bolognese/whitelist_scrubber.rb', line 5

def initialize(options={})
  @direction = :bottom_up
  @tags = options[:tags]
  @attributes = options[:attributes]
end

Instance Method Details

#scrub(node) ⇒ Object



11
12
13
14
15
# File 'lib/bolognese/whitelist_scrubber.rb', line 11

def scrub(node)
  scrub_node_attributes(node) and return CONTINUE if node_allowed?(node)
  node.before node.children
  node.remove
end