-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
fix(core): editor.commands.setContent setting document attributes #5814
fix(core): editor.commands.setContent setting document attributes #5814
Conversation
🦋 Changeset detectedLatest commit: 25a4fb2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 54 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for tiptap-embed ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Related to ueberdosis#5813. Fixes editor.command.setContent not setting attribute on document.
6ed073b
to
25a4fb2
Compare
|
||
Object.entries(document.attrs).forEach(([key, value]) => { | ||
tr.setDocAttribute(key, value) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are planning to remove this branch in the next version (and already have).
So, I don't think that this is the right place for it.
I'm not sure that a method named setContent
should update the doc's attributes. I think you may want to implement this in your application instead. I don't think it belongs in this command
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We tend not to promote doc attributes because they are not synchronized in collaboration with y-prosemirror because of a long standing bug.
So, we don't want to promote something that would not work in the Tiptap ecosystem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, I do understand.
Appreciate the contribution though & your understanding. Will close this as a won't do for now |
Related to #5813. Fixes editor.command.setContent not setting attribute on document.
Changes Overview
Related to #5813. Fixes editor.command.setContent not setting attribute on document.
Implementation Approach
As ProseMirror doesn't seem to be replacing the document attributes, we now do that manually.
Testing Done
Manually, but feel free to recommend me. Also see #5813
Verification Steps
Additional Notes
Checklist
Related Issues
#5813