Class: Rails::HTML4::LinkSanitizer
- Inherits:
-
Rails::HTML::Sanitizer
- Object
- Rails::HTML::Sanitizer
- Rails::HTML4::LinkSanitizer
- Includes:
- Rails::HTML::Concern::ComposedSanitize, Rails::HTML::Concern::Parser::HTML4, Rails::HTML::Concern::Scrubber::Link, Rails::HTML::Concern::Serializer::UTF8Encode
- Defined in:
- lib/rails/html/sanitizer.rb
Overview
Rails::HTML4::LinkSanitizer
Removes a
tags and href
attributes from HTML4 leaving only the link text.
link_sanitizer = Rails::HTML4::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
Methods included from Rails::HTML::Concern::Scrubber::Link
Methods included from Rails::HTML::Concern::Parser::HTML4
Methods included from Rails::HTML::Concern::ComposedSanitize
Methods inherited from Rails::HTML::Sanitizer
best_supported_vendor, html5_support?, #sanitize
Methods included from Sanitizer::VendorMethods
#full_sanitizer, #link_sanitizer, #safe_list_sanitizer, #white_list_sanitizer