tenderlove/rails_autolink

malformed HTML - href should be encoded (& -> &)

Opened this issue · 1 comments

irb(main):011:0> RailsAutolink::VERSION
=> "1.0.9"
irb(main):010:0> helper.auto_link('http://example.com?one=1&two=2') == '<a href="http://example.com?one=1&amp;two=2">http://example.com?one=1&two=2</a>'
=> false

link_to in Rails uses href = ERB::Util.html_escape(href).

You are right
document.write('<a href="?dsf&quot;dsf">asdf</a>')
& is for HTML entities thus in some cases it can be converted and auto_link is broken. agreed? /cc @tenderlove