Class: Loofah::Scrubbers::Prune
- Inherits:
-
Loofah::Scrubber
- Object
- Loofah::Scrubber
- Loofah::Scrubbers::Prune
- Defined in:
- lib/loofah/scrubbers.rb
Overview
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> "
Constant Summary
Constants inherited from Loofah::Scrubber
Loofah::Scrubber::CONTINUE, Loofah::Scrubber::STOP
Instance Attribute Summary
Attributes inherited from Loofah::Scrubber
Instance Method Summary collapse
-
#initialize ⇒ Prune
constructor
rubocop:disable Lint/MissingSuper.
- #scrub(node) ⇒ Object
Methods inherited from Loofah::Scrubber
Constructor Details
#initialize ⇒ Prune
rubocop:disable Lint/MissingSuper
138 139 140 |
# File 'lib/loofah/scrubbers.rb', line 138 def initialize # rubocop:disable Lint/MissingSuper @direction = :top_down end |