Class: Loofah::Scrubbers::Escape
- Inherits:
-
Loofah::Scrubber
- Object
- Loofah::Scrubber
- Loofah::Scrubbers::Escape
- Defined in:
- lib/loofah/scrubbers.rb
Overview
scrub!(:escape)
+:escape+ performs HTML entity escaping on the unknown/unsafe tags:
unsafe_html = "ohai! <div>div is safe</div> <foo>but foo is <b>not</b></foo>"
Loofah.html5_fragment(unsafe_html).scrub!(:escape)
=> "ohai! <div>div is safe</div> <foo>but foo is <b>not</b></foo>"
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 ⇒ Escape
constructor
rubocop:disable Lint/MissingSuper.
- #scrub(node) ⇒ Object
Methods inherited from Loofah::Scrubber
Constructor Details
#initialize ⇒ Escape
rubocop:disable Lint/MissingSuper
160 161 162 |
# File 'lib/loofah/scrubbers.rb', line 160 def initialize # rubocop:disable Lint/MissingSuper @direction = :top_down end |