Skip to content

Commit 5d735a7

Browse files
author
Juanito Fatas
committed
Improve LinkSanitizer's documentation
1 parent 2523282 commit 5d735a7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/rails/html/sanitizer.rb

+5-4
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,12 @@ def sanitize(html, options = {})
4040
end
4141

4242
# === Rails::Html::LinkSanitizer
43-
# Removes a tags and href attributes leaving only the link text
43+
# Removes +a+ tags and +href+ attributes leaving only the link text.
4444
#
45-
# link_sanitizer = Rails::Html::LinkSanitizer.new
46-
# link_sanitizer.sanitize('<a href="example.com">Only the link text will be kept.</a>')
47-
# # => Only the link text will be kept.
45+
# link_sanitizer = Rails::Html::LinkSanitizer.new
46+
# link_sanitizer.sanitize('<a href="example.com">Only the link text will be kept.</a>')
47+
#
48+
# => 'Only the link text will be kept.'
4849
class LinkSanitizer < Sanitizer
4950
def initialize
5051
@link_scrubber = TargetScrubber.new

0 commit comments

Comments
 (0)