Skip to content

Undo after replacing selected text with mark is bringing back mark incorrectly and throws exceptions afterwards #379

@oskar-szwajkowski

Description

@oskar-szwajkowski

I am having setup with plate editor + yjs + yjshistory and cursor, basically all plugins that can be put there are working together

It is working for some time already without problems, but I have run into case when it breaks when selected text contains marks, and then we Undo (ctrl + z)

Suddenly more text than before contains this mark, and when we click on it, it throws Path doesn't match yText, yTarget spans multiple nodes

Similar error has thrown when I tried to create plugin which wraps around slate's insertText and was doing removeMark + insertText, because I have some functionality that works as marks, but I do not want it to be transfered to newly typed text as rest of marks are doing, everything is fine until I do Undo, which is then adding this mark to some additional text and it breaks

It can also be reproduced on slate-yjs demo page Slate-yjs Playground page

Video of this issue:

video1313409905.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions