Open theory opened 2 years ago
Also added
IgnoreURLs:
- mailto:sqitch-users+subscribe@googlegroups.com
To my config and htmltest
still reports it. http URls on the list are properly ignored.
This is a problem as I'm currently using github.com/badoux/checkmail to validate emails and their regex is failing the above. Likely need to remove this and replace with a much more forgiving one.
There is actually another problem at play here:
The mail address with the +
is URL decoded with net/url.QueryUnescape
first. This converts the +
to a space. Notice that the +
changed in the beginning of the error message. This is also the reason why your IgnoreURLs
entry does not work. A workaround is to encode the +
as %2B
. A better solution would be to use PathUnescape
instead (at least for checking mailto
). It does not unescape the +
to a space which is common but controversial ^1 and strongly discouraged for the mailto
schema ^2.
I dug a bit deeper. The actual mail validation is not the problem. Mails with +
are accepted just fine. Just use %2B
as a workaround. The decoding of +
to space by QueryUnescape
is really the only problem here.
This would only concern a small part of the mailto URI handling. RFC6068 states the spaces should be percent encoded and advises against encoding spaces as +
. But I also woudn't want to break something just to move closer to the standard.
What are your thoughts on switching QueryUnescape
to PathUnescape
?
Describe the bug
On this page, I have a
mailto:
link like this:Running
htmltest
(just installed viago install
) it reports:I think this is incorrect: isn't the plus sign valid there, and not representing a space. I tried pasting it into mailtolinkgenerator.com and it also output it with a plus. Looking at rfc6068, there's this table:
If I'm reading it right, the
dot-atom-text
bit (documented in rfc5322 appears to allow+
signs in thelocal-part
:To Reproduce
Steps to reproduce the behaviour:
mailto:
anchor with a+
sign in the local parthtmltest
.htmltest.yml
Source files
https://justatheory.com/2013/06/sqitch-list/
Expected behaviour
A
mailto:
address with a+
in the local part should be valid.Actual behaviour
htmltest
finds it invalid with this message:Versions
htmltest: [e.g. 0.10.1, run
htmltest -v
]Additional context
Thanks!