-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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]: setContent breaks mentions when provided as html #4893
Comments
Does this work with |
@bdbch sry i forgot to add the patch version, fixed that - I'm already on 2.2.3. Also downgraded to 2.1, same problem. And yes the behavior is the same for insertContent. Tested in Chrome and Firefox. Might the data-mention attribute with an empty string ( |
Mh that's weird, the issue looked a lot like the issue we had with links where the link parsing lead to wrong positions and links having either links that were wrapped to long or to short. Not sure why this happens right now - I created a test in #4895 regarding this with a more simplified variant of the mention implementation and there it works fine while mentioning |
What I also recognized is that in older versions you could use the default implementation of the mention template, it would automatically add the data-mention & data-label attributes when you provide id an label props in the command. This no longer works, that's why I created my own template in |
stuck on a very similar issue, I think they might be the same thing. I have used the renderHTML() function, made it a button: When editor mounts and has content value as this example string: it replaces the button tag with the same span with class="suggestion". Sometimes it just removes the button tag, and leaves out just confirmed, it happens on the latest 2.2.3 |
Which packages did you experience the bug in?
core, extension-mention
What Tiptap version are you using?
2.2.3
What’s the bug you are facing?
I remember in earlier versions it was working perfectly fine to re-add a mention tag that was previously extracted from the editor as plain html like e.g.:
In version 2.2 that behavior doesn't work anymore, something parses the mention and transforms it to that:
Anyone has an explanation what happens here? Especially the cropping and re-attaching of a part of the string after the closing tag is weird.
I have defined the
renderHtml
in theMention.configuration
like this:This is the complete initialization of the editor:
What browser are you using?
Chrome
Code example
No response
What did you expect to happen?
The html to get imported witouth any transformations on
setContent
.Anything to add? (optional)
No response
Did you update your dependencies?
Are you sponsoring us?
The text was updated successfully, but these errors were encountered: