Navigation Menu

Skip to content

Commit

Permalink
actually, probably should be URI.escape
Browse files Browse the repository at this point in the history
  • Loading branch information
jamis committed Aug 11, 2012
1 parent 6fb739d commit 97bdb03
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/rails_autolink/helpers.rb
Expand Up @@ -108,13 +108,11 @@ def auto_link_urls(text, html_options = {}, options = {})
link_text = block_given?? yield(href) : href
href = 'http://' + href unless scheme

href = href.gsub(/"/, """)

unless options[:sanitize] == false
link_text = sanitize(link_text)
href = sanitize(href)
end
content_tag(:a, link_text, link_attributes.merge('href' => href), !!options[:sanitize]) + punctuation.reverse.join('')
content_tag(:a, link_text, link_attributes.merge('href' => URI.escape(href.to_str)), !!options[:sanitize]) + punctuation.reverse.join('')
end
end
end
Expand Down

0 comments on commit 97bdb03

Please sign in to comment.