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

[Bug]: autolink does not work and throw an exception #4343

Closed
1 of 2 tasks
steven-qi opened this issue Aug 18, 2023 · 4 comments
Closed
1 of 2 tasks

[Bug]: autolink does not work and throw an exception #4343

steven-qi opened this issue Aug 18, 2023 · 4 comments
Assignees
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug

Comments

@steven-qi
Copy link
Contributor

steven-qi commented Aug 18, 2023

Which packages did you experience the bug in?

core, extension-link, react

What Tiptap version are you using?

2.1.2

What’s the bug you are facing?

With autolink enabled for link extension, whenever I inputted a URL manually and then type a space (expecting that it will turn into a link automatically), the editor removed the latest space and the link remain unlinked.
There is an error in the console.

I first encountered this issue in version 2.1.0, and then upgraded to 2.1.1 and 2.1.2 with no luck.

261482485-dd9cb92c-fc8f-48fe-b9ac-b9153415d6c2

and here is the stack trace I captured at the exact time it is going to throw (type is undefined, but it is trying to invoke type.isInSet).

261483943-d493eee0-d96e-4840-b8d6-8db34b9d52d2

I dig into it a bit, it seems that the cause is that, newState.schema.marks does not have the property code.

https://github.com/ueberdosis/tiptap/blob/develop/packages/extension-link/src/helpers/autolink.ts#L93

image

What browser are you using?

Chrome

Code example

No response

What did you expect to happen?

the inputted text should turn into a link node without any error

Anything to add? (optional)

paste link does work ok

Did you update your dependencies?

  • Yes, I’ve updated my dependencies to use the latest version of all packages.

Are you sponsoring us?

  • Yes, I’m a sponsor. 💖
@steven-qi steven-qi added Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug labels Aug 18, 2023
@steven-qi steven-qi changed the title [Bug]: [Bug]: autolink does not work and throw an exception Aug 18, 2023
@svenadlung
Copy link
Contributor

svenadlung commented Aug 18, 2023

Seems this got added here.

I can imagine that you have not enabled the code extension and that is why the filter ends with an error.

CC @rfgamaral

@bdbch
Copy link
Contributor

bdbch commented Aug 18, 2023

Merged your PR @steven-qi – fix should be included in 2.1.3. I'll close this issue for now – feel free to reopen if the problem still persists in the new version

@bdbch bdbch closed this as completed Aug 18, 2023
@rfgamaral
Copy link
Contributor

Seems this got added here.

Ah, stupid mistake, my bad. Sorry about that!

@bdbch
Copy link
Contributor

bdbch commented Aug 18, 2023

No worries!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug
Projects
Status: Done
Development

No branches or pull requests

4 participants