Something I do quite often is linking to PHP documentation pages. PHP has nice URL rewriting, so you can simply write this to link to the documentation of a function:


Something that happens quite often to me, is that I forget the write out the host:


This breaks the link, causing the answer to be broken and forcing me to fix it in an edit.

I think that it is worth patching markdown to allow such URLs, letting it assume the http protocol. It should be a trivial change, but would make typing URLs simpler and prevent at least some broken URLs.

So, what do you think? Does this happen to you, too? Or is this only something unique to me and thus not worth changing?


1 Answer 1


Disagree. Stackoverflow is a site for professionals. Participants should be able to form valid URLs, not rely on "address bar magic". (The regular link button already provides the http:// prefix anyway.)

You indirectly raise an important point nevertheless. The reason you are asking is because you're trying to go the extra mile of helpfulness. Including links to the manual is indeed good practice. More links to authoritative resources would make SO even more useful. Yet the current UI doesn't provide any aid.

So my counter proposal would be to have a button that autocompletes manual links. Simply mark strlen, click button, magic link to PHP manual thanks to a url pattern ("php" => "http://php.net/%s") lookup table for [php] tag.

  • Participants should be able to form valid URLs — that's not true for all Stack Exchange sites?
    – Arjan
    Jan 19, 2011 at 20:27
  • "Stackoverflow is a site for professionals.": a) Most of StackOverflows participants aren't seasoned professionals, but beginners. b) Short and pertinent code, i.e. laziness, is the sign of a good programmer. From that perspective, saving seven characters, three of them special, is a dream come true, ain't it? I think that disallowing this "address bar magic", just because typing http:// is more "professional", isn't right.
    – NikiC
    Jan 19, 2011 at 20:38
  • 1
    @user148693: Good point. Also as Arjan pointed out, some SE sites are way less technical and attract more beginners. Yet, I'm not sure that necessitates the simpler syntax. Newcomers will use the WYSIWYG button for inserting links anyway; and it's unlikely that anyone will discover the [..](...) url syntax by accident. I'm however not sure if it's feasible to implement the magic url detection. "www.php.net" could be easily interpreted as shortened address. With just "php.net/" to go by it's more assumptive/heuristic. -> Someone else must debate the implementability.
    – mario
    Jan 19, 2011 at 21:01
  • @mario: Well, there is a quick syntax reference on the right, if you ask, answer or edit. The URL notation is in there, too. So, yes, people can discover this "by accident" quite easily (at least I have.) Personally I don't use the URL button because it's just too much latency to switch from keyboard to mouse ;)
    – NikiC
    Jan 22, 2011 at 23:22
  • @nikic: I've been pondering the idea a bit more, and I think it might be feasible to implement it as userscript at least. It seems easy enough to add a bit of markup rewriting (jQuery is there anyway). But I didn't yet really try, and would have a look at the existing stackapps before - there might already be something. I would like some simplification for posting manual links too.
    – mario
    Jan 22, 2011 at 23:33
  • @nikic: I've concocted something stackapps.com/questions/2234/… - it's not quite what your original question requested. Just a dull proof of concept. Ultimatively I would like a more keyboardish or automated approach too.
    – mario
    Mar 21, 2011 at 18:47

You must log in to answer this question.

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