
Rendering an HTML link across Gmail, Outlook, and iCloud mail - dopeboy
http://dopeboy.github.io/render-link-gmail-outlook-icloud/
======
stephenr
This isn't about iCloud/outlook being "picky" it's about gmail doing the wrong
thing.

A html href attribute without an absolute scheme (eg [http://](http://)) is
meaningless to an email client. Guessing that it's either http or https is the
bug here.

~~~
dopeboy
Thanks for the reply stephenr. Why is it meaningless to an email client and
why would the rules be different for an email client versus a traditional web
page?

~~~
pdappollonio
Originally when you don't add the protocol, the link should end up relative to
the domain that's checking the email. Say you're checking your e-mail at:

    
    
      https://mail.google.com/mail/u/0/#inbox/123456abcdef
    

... Then your link without protocol should end up being:

    
    
      https://mail.google.com/mail/u/0/example.com/building/show/123
    

... which doesn't exist as a website (I removed everything including the #
character since that's for SPAs). So Gmail is being a little bit smarty by
assuming you did something wrong in your e-mail so the link should point to
the url example.com/building/show/123 with the protocol included. IMHO iCloud
and Outlook have the proper behavior by not recognizing the link as an actual
link since it's missing the protocol.

~~~
dopeboy
I thought the absence of the _domain_ resulted in that behavior. Checked it
out in JSBin [0] and well I'll be damned. Thanks for the explanation.

[0] -
[http://jsbin.com/mowacanuwa/edit?html](http://jsbin.com/mowacanuwa/edit?html)

~~~
pdappollonio
Yeah, not having protocol is the problem. Now, you can also create links
without the protocol part up to the colon, and the browser will autocomplete
based on if you're visiting the website with or without SSL (HTTPS).

Here's a nice example (with a more complete explanation):
[http://jsbin.com/cexaqoviso/edit?html,output](http://jsbin.com/cexaqoviso/edit?html,output)

