Links with surrounding quotes #5

wants to merge 2 commits into


None yet

2 participants

davidbl commented Sep 24, 2011

One of my users reported a problem with links that are surrounded by quotes. His example was input
which, are running through auto_link, was displayed as
our $HTTP_ATT_TEST_URL ="";;

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 ""
 => "<a href=\"\"></a>" 
 > helper.auto_link '""'
 => "\"<a href=\"\"></a>&quot;" 

(note the second example may be a bit hard to see here, but it has embedded quotes => ' "" '
I think the result of the second example should be

"<a href=\"\">\"\"</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

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