class Rails::HTML::TextOnlyScrubber

Unallowed elements will be stripped, i.e. element is removed but its subtree kept.
Rails::HTML::TextOnlyScrubber allows you to permit text nodes.
=== Rails::HTML::TextOnlyScrubber

def initialize

def initialize
  @direction = :bottom_up
end

def scrub(node)

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