Class: ReeText::TextOnlyScrubber

Inherits:
Loofah::Scrubber
  • Object
show all
Defined in:
lib/ree_lib/packages/ree_text/package/ree_text/scrubbers/text_only_scrubber.rb

Instance Method Summary collapse

Constructor Details

#initializeTextOnlyScrubber

Returns a new instance of TextOnlyScrubber.



4
5
6
# File 'lib/ree_lib/packages/ree_text/package/ree_text/scrubbers/text_only_scrubber.rb', line 4

def initialize
  @direction = :bottom_up
end

Instance Method Details

#scrub(node) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/ree_lib/packages/ree_text/package/ree_text/scrubbers/text_only_scrubber.rb', line 8

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