Links with surrounding quotes #5

Closed
wants to merge 2 commits into
from

Projects

None yet

2 participants

davidbl commented Sep 24, 2011

Hi,
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>&quot;" 

(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.

Thanks

edit: trying to clean up the formatting

Collaborator
xuanxu commented Mar 12, 2012

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.

@xuanxu xuanxu closed this Mar 12, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment