Module: Rails::HTML::Concern::Scrubber::Link

Included in:
Rails::HTML4::LinkSanitizer, Rails::HTML5::LinkSanitizer
Defined in:
lib/rails/html/sanitizer.rb

Instance Method Summary collapse

Instance Method Details

#initializeObject



65
66
67
68
69
70
# File 'lib/rails/html/sanitizer.rb', line 65

def initialize
  super
  @link_scrubber = TargetScrubber.new
  @link_scrubber.tags = %w(a)
  @link_scrubber.attributes = %w(href)
end

#scrub(fragment, options = {}) ⇒ Object



72
73
74
# File 'lib/rails/html/sanitizer.rb', line 72

def scrub(fragment, options = {})
  fragment.scrub!(@link_scrubber)
end