Hacker News new | comments | show | ask | jobs | submit login
Rendering an HTML link across Gmail, Outlook, and iCloud mail (dopeboy.github.io)
2 points by dopeboy on Dec 25, 2016 | hide | past | web | favorite | 5 comments

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://) is meaningless to an email client. Guessing that it's either http or https is the bug here.

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?

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:

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

... 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.

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

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

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact