ckeditor5 icon indicating copy to clipboard operation
ckeditor5 copied to clipboard

Applying Operation from JSON

Open dustinormond opened this issue 5 years ago • 2 comments

I am trying to apply an operation from JSON and am really struggling to get it to work. I have tried two different methods and neither seem to work. I would appreciate any help you can offer.

Method 1: applyOperation

ckeditor.model.applyOperation(operation);

This method generates the following error: image

Method 2: writer

ckeditor.model.change( writer => {
    if (operation.__className === 'InsertOperation') {
        writer.insertText(operation.nodes[0].data, operation.position );
    }
});

This method generates the following error: image Do I need to convert the position first? If so, how? I tried ckeditor.model.position.fromJSON(operation.position).

This is what my operation looks like in JSON format: image

dustinormond avatar Jan 26 '21 16:01 dustinormond

There has been no activity on this issue for the past two years. We've marked it as stale and will close it in 30 days. We understand it may be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.

CKEditorBot avatar Sep 06 '23 05:09 CKEditorBot

We've closed your issue due to inactivity over the last year. We understand that the issue may still be relevant. If so, feel free to open a new one (and link this issue to it).

CKEditorBot avatar Oct 13 '23 05:10 CKEditorBot