: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.fragment(unsafe_html).scrub!(:prune) => "ohai! <div>div is safe</div> "
Generated with the Darkfish Rdoc Generator 2.