Class: ReeText::StripTags

Inherits:
Object
  • Object
show all
Includes:
Ree::FnDSL
Defined in:
lib/ree_lib/packages/ree_text/package/ree_text/functions/strip_tags.rb

Instance Method Summary collapse

Instance Method Details

#call(html) ⇒ Object



28
29
30
31
32
33
34
# File 'lib/ree_lib/packages/ree_text/package/ree_text/functions/strip_tags.rb', line 28

def call(html)
  return html if is_blank(html)

  loofah_fragment = Loofah.fragment(html)
  loofah_fragment.scrub!(TextOnlyScrubber.new)
  properly_encode(loofah_fragment, encoding: 'UTF-8')
end