Markup: "mailto" links, possibly with optional Subject, not rendering correctly

Created on 22 Mar 2017  路  4Comments  路  Source: github/markup

In Source Han Sans and other projects in our organization, the use of _mailto_ is not working, perhaps when an optional Subject is specified.

The following is specified: [Dr. Ken Lunde](mailto:[email protected]?subject=[GitHub] Source Han Sans)

This is expected to be rendered as only _Dr. Ken Lunde_, but when clicked, will initiate an email in the default email client with "[GitHub] Source Han Sans" specified as the default Subject.

Instead, I see the literal markdown, per the screenshot below:

github-markdown-issue

This happens regardless of the Browser: Chrome, Firefox, and Safari running on macOS Version 10.12.3.

Most helpful comment

Hey there! 馃憢 This actually has to do with URL requirements per the CommonMark spec. CommonMark does not allow for spaces in URLs, so you need to encode those as %20 in order for this to be a valid URL:

[Dr. Ken Lunde](mailto:[email protected]?subject=[GitHub]%20Source%20Han%20Sans)

Dr. Ken Lunde

You can review CommonMark's definition of a URL (link destination) here:

https://github.github.com/gfm/#link-destination

All 4 comments

Hey there! 馃憢 This actually has to do with URL requirements per the CommonMark spec. CommonMark does not allow for spaces in URLs, so you need to encode those as %20 in order for this to be a valid URL:

[Dr. Ken Lunde](mailto:[email protected]?subject=[GitHub]%20Source%20Han%20Sans)

Dr. Ken Lunde

You can review CommonMark's definition of a URL (link destination) here:

https://github.github.com/gfm/#link-destination

Thank you!

Thank you for posting this.

I was here battling to figure out how to add support e-mail to the README.md

Thank you!! because of your explanation. Helped me make this link:

general code:
<a href="mailto:[email protected]?"><img src="https://img.shields.io/badge/gmail-%23DD0031.svg?&style=for-the-badge&logo=gmail&logoColor=white"/></a>

Was this page helpful?
0 / 5 - 0 ratings