class Loofah::Scrubbers::Prune

scrub!(:prune)

:prune removes unknown/unsafe tags and their contents (including their subtrees):

unsafe_html = "ohai! <div>div is safe</div> <foo>but foo is <b>not</b></foo>"
Loofah.html5_fragment(unsafe_html).scrub!(:prune)
=> "ohai! <div>div is safe</div> "