Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper mailto: rejected #248

Closed
RHaworth opened this issue Feb 27, 2016 · 2 comments
Closed

Proper mailto: rejected #248

RHaworth opened this issue Feb 27, 2016 · 2 comments

Comments

@RHaworth
Copy link

I coded this link:
<a href='mailto:Roger%20W%20Haworth%20<W@RHaworth.net>?subject=W3%20Validator'>
but validator rejects it saying:

Bad value mailto:Roger%20W%20Haworth%20W@RHaworth.net?subject=W3%20Validator for attribute href on element a: Illegal character in scheme data: < is not allowed.

<a href='mailto:Roger%20W%20Haworth%20&#60;W@RHaworth.net&#62;?subject=W3%20Validator'>Try it now!</a>

This a "proper" email address in the format "Plain Name &lt;Name@domain&#62;". Clicking on the link takes me to Outlook Express perfectly happily. I have escaped the <> around the email address as &#60; and &#62; (if I use &lt; and &gt; the error still reports). So why is Validator rejecting it?

@sideshowbarker
Copy link
Contributor

mailto:Roger%20W%20Haworth%20%3CW@RHaworth.net%3E?subject=W3%20Validator

@sideshowbarker
Copy link
Contributor

I have escaped the <> around the email address as &#60; and &#62; (if I use &lt; and &gt; the error still reports).

To escape (encode) particular characters in URLs, you need to percent-encode (aka “URL encode”) them.

So instead of using &#60; and &#62;, you need to %3C and %3E.

The following tables show the percent-encoded representations for some common characters:

Reserved characters after percent-encoding
! # $ & ' ( ) * + , / : ; = ? @ [ ]
%21 %23 %24 %26 %27 %28 %29 %2A %2B %2C %2F %3A %3B %3D %3F %40 %5B %5D
Common characters after percent-encoding (ASCII or UTF-8 based)
newline space " % - . < > \ ^ _ ` { | } ~
%0A or %0D or %0D%0A %20 %22 %25 %2D %2E %3C %3E %5C %5E %5F %60 %7B %7C %7D %7E

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants