class Rails::Html::FullSanitizer
# => Bold no more! See more here…
full_sanitizer.sanitize(“Bold no more! <a href=‘more.html’>See more here</a>…”)
full_sanitizer = Rails::Html::FullSanitizer.new
Removes all tags but strips out scripts, forms and comments.
=== Rails::Html::FullSanitizer
def sanitize(html, options = {})
def sanitize(html, options = {}) return unless html return html if html.empty? loofah_fragment = Loofah.fragment(html) remove_xpaths(loofah_fragment, XPATHS_TO_REMOVE) loofah_fragment.scrub!(TextOnlyScrubber.new) properly_encode(loofah_fragment, encoding: 'UTF-8') end