class Rails::HTML5::LinkSanitizer
Rails::HTML5::LinkSanitizer
¶ ↑
Removes a
tags and href
attributes from HTML5
leaving only the link text.
link_sanitizer = Rails::HTML5::LinkSanitizer.new link_sanitizer.sanitize('<a href="example.com">Only the link text will be kept.</a>') # => "Only the link text will be kept."