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

If this does not classify as a (probably anyway), then I would like to present this as a for convenience when copy-pasting certain URLs.

The [Title](URL) markdown does not recognize URLs that are missing a scheme/protocol. For example:

[Crittercism](www.crittercism.com/register?codez=ihdqcwduji)

I know RFC 1738 and RFC 3305 would not consider this as a valid URL (due to the lack of a scheme), but it would be nice if the Markdown engine converted this to a hyperlink anyway because of the [Title](URL) directive.

The logic seems fairly straightforward: If whatever is inside the ( ) does not start with a valid scheme (Here's a full list of Official IANA Uniform Resource Identifier Schemes), then prepend http:// to the text inside ( ). Or, to cut out most false-positives, prepend only to URLs starting with www (no scheme).


Example

Without http:// it shows the title, but no clicky linky:

Crittercism - Real Time Crash Reports for iOS & Android Apps!

[Crittercism - ...](www.crittercism.com/register?codez=ihdqcwduji)

With http:// it works as intended:

Crittercism - Real Time Crash Reports for iOS & Android Apps!

[Crittercism - ...](http://www.crittercism.com/register?codez=ihdqcwduji)
share|improve this question
2  
What problem does this solve? If you're being lazy/efficient in your link adding—or somehow don't know about http://—you're almost certainly copy-pasting URLS from address bars/hyperlinks and would always have the correct scheme anyway. No UA that I know of drops the http:// when copying a URL. –  user149432 Feb 4 '12 at 23:18
1  
@M The main problem is that the markdown kind-of half parses it and makes it appear that the url was converted properly b/c it only shows the text from the [] and I figure it would take maybe 5 minutes to implement a fix. Not a huge benefit, but a quick fix so why not ). –  chown Feb 5 '12 at 0:28

1 Answer 1

up vote 14 down vote accepted

The [TITLE](URL) markdown does not recognize urls that are missing a scheme/protocol

If you mean absolute/external URLs that start with a domain component, well, neither does the href attribute in HTML. The protocol is required for absolute URLs, otherwise they'll just be treated as relative URLs which, for this particular site, end up ignored and not rendered as links.

I see no reason Markdown should allow something that HTML doesn't.

If you insist on leaving out the protocol, the syntax for protocol-relative URLs includes the double slashes:

[Crittercism - ...](//www.crittercism.com/register?codez=ihdqcwduji)

Crittercism - Real Time Crash Reports for iOS & Android Apps!

share|improve this answer
5  
// sounds like a bad idea. I think it'll break once SO allows https, but the other site doesn't. –  CodesInChaos Feb 5 '12 at 15:10
2  
Thats actually pretty cool that you can leave out the protocol and still include the root // and it works. I guess I'll just have to be less lazy and double check the urls after pasting them in ). –  chown Feb 6 '12 at 18:01

You must log in to answer this question.

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