-
-
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
[Bug]: After pasting HTML content with <a> tags link marks are created in wrong locations #4769
Comments
Same problem here, it seems related with #4700 |
Same issue here. |
This is now reproducible on https://templates.tiptap.dev/ with the HTML content example from reproduction steps. If HTML is pasted in the middle of the document link marks are mismatched and set in incorrect locations. |
Same here, I still see the ![]() It throws the exception in the |
Same problem: I noticed that this error occurs when pasting content that has lists with links. Otherwise, when only the link is pasting, this error does not appear to me. |
I'm still experiencing many issues with pasting content with links in anything after version 2.1.10 |
After some initial testing this appears fixed in 2.2.3. Thanks! |
Which packages did you experience the bug in?
extension-link
What Tiptap version are you using?
2.2.1
What’s the bug you are facing?
I'm trying to paste HTML content from another web page into tiptap.
--- start copying below ---
Some search engines:
What is a search engine: https://en.wikipedia.org/wiki/Search_engine
--- stop copying above ---
What browser are you using?
Chrome
Code example
https://stackblitz.com/edit/vue3-vite-starter-pj5vfd
What did you expect to happen?
Content should be pasted with links parsed correctly and no console errors should be thrown.
Anything to add? (optional)
Stack trace
Introduced in tiptap v2.1.14, most likely with this PR #4700.
I'm not sure if parsing HTML content from
PasteEvent
even required here at all,index
values fromhtml
won't match locations intext
. I assume that's why exception is thrown.tiptap/packages/extension-link/src/link.ts
Lines 170 to 185 in 8ba30f3
By that point HTML content and anchor tags were already parsed by prosemirror via
parseHTML
and schema attributes.Did you update your dependencies?
Are you sponsoring us?
The text was updated successfully, but these errors were encountered: