Class: Shamu::Attributes::HtmlSanitation::NoneScrubber

Inherits:
Loofah::Scrubber
  • Object
show all
Defined in:
lib/shamu/attributes/html_sanitation.rb

Instance Method Summary collapse

Constructor Details

#initializeNoneScrubber

Returns a new instance of NoneScrubber.



158
159
160
# File 'lib/shamu/attributes/html_sanitation.rb', line 158

def initialize
  @direction = :bottom_up
end

Instance Method Details

#scrub(node) ⇒ Object



162
163
164
165
166
167
168
169
# File 'lib/shamu/attributes/html_sanitation.rb', line 162

def scrub( node )
  if node.text?
    Loofah::Scrubber::CONTINUE
  else
    node.before node.children
    node.remove
  end
end