-
-
Notifications
You must be signed in to change notification settings - Fork 788
-
-
Notifications
You must be signed in to change notification settings - Fork 788
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
Asciidoctor not recognizing valid email #3154
Comments
Actually, your tld is one character too long 😉 asciidoctor/lib/asciidoctor.rb Line 834 in 1e88d74
I believe it will be way slower to check the tld against https://publicsuffix.org/list/, right ? We could, of course, just change the regular expression to accept tld between 2 and 5 characters but we have to be careful because we could fall on the other side of the fence (ie. recognizing sentence as email). |
For reference quite a few "new" tld are longer than 4 letters:
|
It's perfectly valid to even have an ip address as the "domain", per the specification. I would simply remove any post |
It's not Asciidoctor's intent to validate e-mail addresses. That would be a fool's errand. It's Asciidoctor's attempt to do a best effort to detect an implicit e-mail address under reasonable circumstances without performing unwanted replacements. Our job is to find that balance.
That would start matching all kinds of things we don't want to match and break documents. When the e-mail address is too obscure for a reasonable match, you always have the option of using the formal macro (i.e.,
You would be surprised. Btw, the link prefix and explicit text are not required. The following will work:
|
If we did change the regexp, I think 5 characters would be reasonable. I don't really want to go longer than that. |
@graphitefriction I think we should document how Asciidoctor determines which e-mail address to match and the slightly longer workaround (from the end of my comment above) when the e-mail address doesn't match automatically. |
If that's the case, then I certainly understand the hesitance. The abovementioned
Oh! I didn't realize (or forgot) that. Thanks a lot :D |
I really don't want to get into the business of cross referencing valid TLDs. That is way overreaching, IMO. Again, we will make a best case based on a likely pattern (which I'm fine with extending to a 5-character TLD) and beyond that, the formal macro is required. |
According to http://data.iana.org/TLD/tlds-alpha-by-domain.txt, here are the counts for each length (minus some obscure ones we wouldn't match anyway):
So there are actually more 6-character TLDs than 5. Hmmm. |
(Other good examples of 5-character TLDs are |
I can't find any 6-character TLDs in use, even when scanning git commits (except for ones that are clearly fake). |
On the other hand, I determined that even a TLD length up to 7 doesn't catch stuff we don't want to catch...so that at least is not a risk. |
Let's proceed with 5 characters for now, and we'll extend when the use cases are presented. |
My developer email is
toast@toastin.space
.This is not recognized by asciidoctor as an email (for automatic link generation purposes).
It also isn't showing up in the atom.io highlighter.
I end up needing to explicitly specify
link:mailto:toast@toastin.space[toast@toastin.space]
to get the same effect.I suspect (but have not verified) that this is because asciidoctor keeps a list of "valid" TLDs that is incomplete (based on a different similar email address working just fine).
The text was updated successfully, but these errors were encountered: