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

Expose Linkify validate method in Link extension #2779

Closed
1 task done
georgemandis opened this issue May 13, 2022 · 3 comments · Fixed by #2781
Closed
1 task done

Expose Linkify validate method in Link extension #2779

georgemandis opened this issue May 13, 2022 · 3 comments · Fixed by #2781
Assignees

Comments

@georgemandis
Copy link
Contributor

georgemandis commented May 13, 2022

What problem are you facing?

The autolink attribute on the Link extension is a nice idea, but in practice it's less useful due to the long list of TLDs included by Linkify. We regularly get feedback asking why our editor turns certain word combinations into links when a user forgets to enter a "space" after a period.

I recognize hamster.vodka is a valid gTLD, but we're a little tired of explaining that 😂

What’s the solution you would like to see?

I also realize this behavior is powered by Linkify. Would it be possible to amend the Link extension and expose the validate method it provides?
https://linkify.js.org/docs/options.html#validate

That should allow us to write our own regex and just look for com|net|org.

What alternatives did you consider?

The alternative is disabling autolink, which we'll probably do in the meantime. We'd like to keep it for some of the more common gTLDs though.

Anything to add? (optional)

No response

Are you sponsoring us?

  • Yes, I’m a sponsor. 💖
@georgemandis georgemandis added the Type: Feature The issue or pullrequest is a new feature label May 13, 2022
@bdbch
Copy link
Contributor

bdbch commented May 13, 2022

Hey @georgemandis

I opened a PR for this, see #2781

would this satisfy your needs?

@bdbch bdbch removed the Type: Feature The issue or pullrequest is a new feature label May 13, 2022
@bdbch bdbch self-assigned this May 13, 2022
@georgemandis
Copy link
Contributor Author

@bdbch I think so! That looks pretty good :)

@bdbch
Copy link
Contributor

bdbch commented May 13, 2022

Great! Looking forward for the merge!

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

Successfully merging a pull request may close this issue.

2 participants