What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 131 Stack Exchange communities.

When somebody posts a URL in the comments, it is automatically cleaned up and turned into a link. This is an excellent feature, but the system does not allow some symbols in URLs. For example, I've added a comment to this question consisting entirely of the text

http://en.wikipedia.org/wiki/Murphey's_Law

but when you try to click on the link, you get taken to the page http://en.wikipedia.org/wiki/Murphey, which is the wrong page.

Is there some reason ' is assumed not to be in URLs? Can we change the comment link algorithm to allow 's?

share|improve this question
    
5  
    
If I've understood random's comment to Jeff's answer correctly, this behavior is completely standard. Is it possible to tell my browser to automatically encode the URL in my URL bar so that I can just copy and paste? –  Anton Geraschenko Oct 8 '09 at 20:24
    
What about http://☃.net and www.☃.net ;-) –  Arjan Mar 1 '10 at 7:49

2 Answers 2

up vote 3 down vote accepted

So encode the ' then

http://en.wikipedia.org/wiki/Murphey%27s_Law

share|improve this answer
    
That's a fine workaround, but it would be really nice if I could just paste the URL in as it appears at the top of my browser. Is there some reason not to allow that? –  Anton Geraschenko Oct 7 '09 at 22:45
3  
Actually, I'm being a bit dodgy. The reason I want this feature-request implemented is because I have an SE site and I don't want my users to have to know how to encode 's. But Michael Pryor has said that if a feature-request pertains to the S[OFU] sites as well as SE sites, he'd rather wait for you to implement it. –  Anton Geraschenko Oct 7 '09 at 22:48
1  
Quotes are reserved characters: ietf.org/rfc/rfc3986.txt –  random Oct 8 '09 at 0:58

Looks like its related to WMD, so, I just tried to reverse-engineer some of its js.

basically, adding ' to this line

var E=/^(<a\shref="(\#\d+|(https?|ftp):\/\/[-A-Za-z0-9+&@#\/%?=~_|!:,.;\(\)']+)"(\stitle="[^"<>]+")?\s?>|<\/a>)$/i;

and this line

G=G.replace(/(^|\s)(https?|ftp)(:\/\/[-A-Z0-9+&@#\/%?=~_|\[\]\(\)!:,\.;']*[-A-Z0-9+&@#\/%=~_|\[\]])($|\W)/gi,"$1<$2$3>$4");

and removing ' from [^'">\s] from this line

G=G.replace(/<((https?|ftp):[^">\s]+)>/gi,'<a href="$1">$1</a>');

works here for http://en.wikipedia.org/wiki/Murphey's_Law

But, better replace ' to %27 in background, because its smells like SQLi :D

PS: There is accepted answer already, but Jeff just bumped it, so looks like he might considering this again.

share|improve this answer
1  
Great, please add ☃ as well ;-) –  Arjan Mar 1 '10 at 8:22
    
Heh, thats need to judge by Jeff :D –  YOU Mar 1 '10 at 8:24
    
this has nothing to do with WMD, it is related to URLs in comments per the title.. I retagged it to help. –  Jeff Atwood Mar 1 '10 at 8:24
    
Jeff, how about in normal question and answer?, now, url with ' does not work too. –  YOU Mar 1 '10 at 8:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .