I am trying to post this link


on StackOverflow, and it doesn't get linked because of the '.

How can I convert it into a postable link (w/o using any URL shortners, of course)?

I remember ( can be replaced by a %028. What is the similar conversion for a '?

Okay, I realized after posting that it was not getting linked in the JavaScript preview, but it gets linked when it is posted. Still, how can I convert the links to JavaScript preview safe links as mentioned above?

  1. Use Firefox. It'll automatically encode that pesky apostrophe when you copy the URL out of the address bar: http://en.wikipedia.org/wiki/Tarjan%27s_off-line_least_common_ancestors_algorithm

  2. Replace the apostrophe with a HTML entity:

  3. Don't worry about it. As you note, it works once you've posted it.


As of recently, the editor will do that automatically for you when entering a link via the button (or Ctrl-L).


This is a bug. ' is valid in the path portion of the URL (and so are ( and )).

See RFC 3986:

URI           = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
hier-part     = "//" authority path-abempty
              / path-absolute
              / path-rootless
              / path-empty
path-abempty  = *( "/" segment )
segment       = *pchar
pchar         = unreserved / pct-encoded / sub-delims / ":" / "@"
sub-delims    = "!" / "$" / "&" / "'" / "(" / ")"
              / "*" / "+" / "," / ";" / "="
  • True, so far as it goes, but when you're dealing with systems that try to parse URLs out of markup using regular expressions that probably were never tested against anything at all unusual, it's a good deal safer to just escape punctuation. – Shog9 Aug 22 '10 at 21:16
  • @Shog What systems are you talking about? This is about stackoverflow code recognizing a valid URL. It does not recognize a valid URL, hence it's a bug. If the problem is dealing with those buggy systems, SO can just escape those characters afterwards... – Artefacto Aug 22 '10 at 22:57
  • sure it's a bug. But not one that will be fixed. Lazer's question was, "How can I make this link work anyway?" not "Is this a bug". – Shog9 Aug 22 '10 at 23:26
  • @Shog So... this was fixed server-side, but not client-side. Brilliant. – Artefacto Aug 22 '10 at 23:43

You must log in to answer this question.

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