pycrdt
pycrdt copied to clipboard
Add to_delta on XmlText
In yjs, there is a toDelta method to get the contents of the xmltext node:
https://docs.yjs.dev/api/shared-types/y.xmltext
Looks like pycrdt only has a to string, which makes it hard to port code over.
Besides toDelta, applyDelta would also be very useful;
ytext.applyDelta(delta: Delta)
Apply a Text-Delta to the Y.Text instance.
ytext.toDelta(): Delta
Retrieve the Text-Delta-representation of the Y.Text instance. The Text-Delta is equivalent to Quills' Delta format.
https://docs.yjs.dev/api/shared-types/y.text