One of my users reported a problem with links that are surrounded by quotes. His example was input
our $HTTP_ATT_TEST_URL ="https://blah.blah.com"
which, are running through auto_link, was displayed as
our $HTTP_ATT_TEST_URL ="https://blah.blah.com";;
The app is running rails 3.0.7.
Using Rails 3.1.0 and rails_autolink 1.0.2, console testing gives
> helper.auto_link "www.example.com"
=> "<a href=\"http://www.example.com\">www.example.com</a>"
> helper.auto_link '"www.example.com"'
=> "\"<a href=\"http://www.example.com\">www.example.com</a>""
(note the second example may be a bit hard to see here, but it has embedded quotes => ' "www.example.com" '
I think the result of the second example should be
"<a href=\"http://www.example.com\">\"www.example.com\"</a>, (ie, the surrounding quotes only around the link text)
If you agree, this pull request causes the surrounding quotes to show as I expect and doesn't seem to break any of the other tests.
edit: trying to clean up the formatting
quotes around links should only be added to link_text
Merge branch 'surround_link_text_with_quotes'
Thanks for the pull. But I don't think this is the intended behaviour of the helper. Only the url will be converted into the link, not any sorrounding characters, that would create a ton of edge cases.