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.



7
8
9
10
11
# File 'lib/bolognese/whitelist_scrubber.rb', line 7

def initialize(options={})
  @direction = :bottom_up
  @tags = options[:tags]
  @attributes = options[: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