You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, I'd advise not to use compose() method unless you're absolutely sure what you are doing is correct. Especially if you need to apply a local change. See dartdoc for NotusDocument.compose for more details.
Second, your imageDelta is not a valid image embed, this is why you don't see it in the result. This is another reason I do not recommend using compose. Normally you should never try to compose hand-written Deltas into Notus documents. You risk corrupting the document state this way.
A better (and recommended) way to apply changes to a document is using all the other methods on NotusDocument. So for your case:
final doc =NotusDocument();
final delta = doc.format(0, 0, NotusAttribute.embed.image('http://img.jpg'));
// format() method returns actual Delta composed into this document, // so you can observe it if neededprint(delta);
Thank you for your explanation!
I understood right way to apply changes to NotusDocument, also why my code failed.
I needed zero width space (8203) for insert.
Hi,
I am not sure this is bug or spec.
But when I tried to compose embed image attribute into NotusDocument, the image information was lost.
Here is the code I wrote.
The text was updated successfully, but these errors were encountered: