-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Autolink #1209
Comments
Yes, this is already on our list and I think it will land in stable 2.0 ✌️ |
Not make it into v2? :) |
Hey, it’s coming. Last week I merged a massive PR for inputrules and pasterules. This also included the integration of linkify (on paste). After some research, this seems to be the most stable library for the best URL detection. This is the basis for writing a method to set attributes live as you type. The same technique will also be necessary for a hashtag extension. So sorry it’s probably going to take a little longer. But it will come! |
I'm curious, why does a hashtag extension need to "set attributes live as you type"? I mean, I've always imagined a hashtag extension very similar to the mentions extension, but with a different trigger character. What am I missing? |
@rfgamaral In my eyes, a mention extension should work with unique user names. This can also be an unique id instead of an user name. So we are rendering an atom node where you can’t change the user name after creating the mention. A hashtag is a simple way to highlight a string that starts with a #. So we have to update the bounding of the node if its text changes (putting a space within the hashtag should split the node for example) |
@philippkuehn In my mind, I had a different use case, similar to mentions, but with a different trigger character. But I think I see what you mean, similar to how Twitter works, right? |
@rfgamaral yeah maybe we’ll provide an option for the mention and hashtag extensions to render as text or atom node. |
@philippkuehn Just wondering, what's missing for this to be possible with Tiptap? |
Nothing is missing. I just need to find time and build it 😅 On a feature basis, it's definitely a high priority. |
There is an open PR for it now: #2226 |
Nice to have the auto-link feature! |
@lfantone oh, you are right. this patch should help. |
Hi @philippkuehn, I noticed your comment regarding the hashtag extension. I'm currently in need of this feature for my project, but I couldn't find it in the Tiptap documentation. Could you please point me in the right direction, or provide an example of how I can customize a hashtag extension for my project? Thank you! |
It would be great to have some kind of autolinking support for the link component. In other words typing
google.com
automatically turns it into a url.You can see how Remirror does that here:
https://github.com/remirror/remirror/blob/beta/packages/remirror__extension-link/src/link-extension.ts#L356
Regexwise, I suggest using this package which has hard-coded TLDs.
https://www.npmjs.com/package/url-regex-safe
The text was updated successfully, but these errors were encountered: