-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
Email links followed by a hyphen are not detected #93
Comments
Please explain use case. Because looks like broken content. Linkifier is expected to be used with valid human-readable texts. |
This came up in HabitRPG/habitica#12437 Someone has a sentence with an email [email protected] expects the address to have a link. Also, every other punctuation I've added as a suffix after the link still tests as true. It's just hyphens that make the text test as false. |
Looks like GitHub's link parser also has amusing behavior when hyphens are involved 😆 |
Similar poblem exists for links. I see how heading for emails can be improved, but not sure about tail. |
It's curious that it's just hyphens. To be honest, I have trouble parsing the regexes, so I can't be of much help. The simplest I idea I have is to strip trailing hyphens (which are not part of TLD/SLDs), if that's a feasible solution. |
When there is a valid email address, such as [email protected], if it is followed by a hyphen, linkify.test returns false:
I would expect both to be true.
You can test this by adding these two lines to
test/fixtures/lines.txt
:The text was updated successfully, but these errors were encountered: