class Loofah::Scrubbers::Strip
=> “ohai! <div>div is safe</div> but foo is not”
Loofah.html5_fragment(unsafe_html).scrub!(:strip)
unsafe_html = “ohai! <div>div is safe</div> <foo>but foo is not</foo>”:strip
removes unknown/unsafe tags, but leaves behind the pristine contents:
=== scrub!(:strip)
def initialize # rubocop:disable Lint/MissingSuper
def initialize # rubocop:disable Lint/MissingSuper @direction = :bottom_up end
def scrub(node)
def scrub(node) return CONTINUE if html5lib_sanitize(node) == CONTINUE node.before(node.children) node.remove STOP end