Closed ezeidman closed 1 year ago
Latest commit: dbe9895692faa92283861f3cd7e0378004f8284c
The changes in this PR will be included in the next version bump.
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
@BitPhinix I know you said you're very busy. Would be very grateful if you can review this week :) Thank you!
Thanks for this and sorry for the delay - will create a new version now
Updates applyToSlate to ignore retain attributes that correspond with XmlText nodes. We already ignore insert attributes for XmlText nodes so should do the same for retains for consistency:
https://github.com/BitPhinix/slate-yjs/blob/966b9325ff312058023d017f857fbb6ac9a7a8a4/packages/core/src/utils/convert.ts#L17-L23
XmlText do have attributes but these are different from the attributes on inserts and retains
We still use and update the second kind of attribute:
Initially I thought this was a Yjs issue so there is some more context here: https://github.com/yjs/yjs/issues/529. A big part of the problem is that if you have a mixture of text and XmlText underneath a node, formatting attributes that were only ever applied to the text can show up in retain attributes that apply to non-text. This results in non-text nodes in the Slate tree getting nonsensical text attributes.