Class: Rails::HTML5::LinkSanitizer

Overview

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."

Constant Summary

Constants inherited from Rails::HTML::Sanitizer

Rails::HTML::Sanitizer::VERSION

Method Summary

Methods included from Rails::HTML::Concern::Serializer::UTF8Encode

#serialize

Methods included from Rails::HTML::Concern::Scrubber::Link

#initialize, #scrub

Methods included from Rails::HTML::Concern::Parser::HTML5

#parse_fragment

Methods included from Rails::HTML::Concern::ComposedSanitize

#sanitize

Methods inherited from Rails::HTML::Sanitizer

best_supported_vendor, html5_support?, #sanitize

Methods included from Rails::HTML4::Sanitizer::VendorMethods

#full_sanitizer, #link_sanitizer, #safe_list_sanitizer, #white_list_sanitizer