Possible Duplicate:
URL detecting error with address like “http://en.wikipedia.org/wiki/Octet_(computing)”

If a link ends with a closing bracket, the auto-generated link doesn't work. This is mainly an issue for including links to Wikipedia articles.

Example: http://en.wikipedia.org/wiki/Dagger_(typography) The link is broken, because the closing bracket is missing from the URL.

If, on the other hand, the link contains brackets but doesn't end in them, the links works fine: http://en.wikipedia.org/wiki/Dagger_(typography)#History

My apologies if this is a duplicate! I did search, but couldn't find anything relevant. If it can't be fixed (the problem is a little more nuanced than I immediately realised), I'm still interested in having a good answer and simple solution should I come across the problem again.

  • This was discussed in early October 2010 but I can't find a link. – Pops Mar 28 '12 at 19:01
  • 1
    It seemed like too common an issue not to have been encountered before! – Hannele Mar 28 '12 at 19:02
  • 3
    Ah, here we go. (In the post I was thinking of, someone asked about Wikipedia specifically, but it got closed as a dupe of my first link.) – Pops Mar 28 '12 at 19:05
  • I believe this is still a bug - the post you've linked to discusses brackets in general, and this was eventually implemented. Presumably, it was intended that all links with brackets in them should work, while links ending in closing brackets still don't. – Hannele Mar 28 '12 at 19:11
  • I'm not clear why the other post you linked to was closed as a duplicate - although %29 was offered as a workaround, it seems an unreasonable expectation for the less programmer-y sites. – Hannele Mar 28 '12 at 19:22
  • Agreed. I was just giving background; I didn't vote to close. Since posting my last comment, I brought back my old sandbox test answer with less-than-perfect results. – Pops Mar 28 '12 at 19:24
  • Well, that question was asked on Oct 3, 2010, when there barely were any less-programmer-y sites. – Pops Mar 28 '12 at 19:25
  • @PopularDemand odd, see my answer. (which I thought was the answer until I submitted it) – Naftali aka Neal Mar 28 '12 at 19:31
  • Yeah, @amanaPlanaCAnalPAnaMA, I commented on that answer, and then deleted it when I saw that you had posted your own comment a second earlier, realizing what you'd done. – Pops Mar 28 '12 at 19:32
  • @PopularDemand It's a more difficult problem than I'd realised - linked in one of the posts you mention is Jeff's blog post on auto-parsing URLs. – Hannele Mar 28 '12 at 19:34
  • @PopularDemand this is very very odd. I am not sure why it is acting like that.... – Naftali aka Neal Mar 28 '12 at 19:34
  • For full disclosure, I found this post mentioning that the problem turns up in comments, although the poster didn't notice that the problem also exists in regular questions/answers. – Hannele Mar 28 '12 at 19:46

A workaround is to put a dummy # at the end after the closing bracket: http://en.wikipedia.org/wiki/Dagger_(typography)#

  • This is a neat solution - a huge advantage that it doesn't require using characters that aren't part of a real link. – Hannele Mar 29 '12 at 13:50

If you do http://en.wikipedia.org/wiki/Dagger_(typography\) and escape the last parenthesis, it works fine (only in the edit window):


I believe this is a in the the markdown script.


The autolinker intentionally avoids matching your example, so I imagine this is due to the various edge cases where this might be problematic.

Ideally, you should be linking to the Dagger article on Wikipedia,

[to the Dagger article on Wikipedia](http://en.wikipedia.org/wiki/Dagger_(typography))

Or using angle brackets if you insist on the bare link: http://en.wikipedia.org/wiki/Dagger_(typography)

  • 1
    Then why does it work in the edit window here? – Naftali aka Neal Mar 28 '12 at 19:32
  • It's less about my particular preference, and more about noting confused users of the English Language SE. Angle brackets might be the most useful suggestion - I didn't immediately realise how difficult the issue is! – Hannele Mar 28 '12 at 19:40
  • 2
    @amanaPlanaCAnalPAnaMA It's a side-effect of how the backslash escaping works in the client-side renderer; the \) sequence is temporarily replaced with something that matches the autolinker regex, but I think the replacement is slightly different (and non-matching) in the server-side renderer. – Tim Stone Mar 28 '12 at 19:51
  • 1
    @TimStone that is very very odd... – Naftali aka Neal Mar 28 '12 at 19:52
  • @Hannele That's fair enough :) But yeah, the issue is rather complex unfortunately, so I imagine changing this behaviour without impacting anything else would be problematic. – Tim Stone Mar 28 '12 at 19:54

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