Skip to content
This repository was archived by the owner on Jun 6, 2025. It is now read-only.
This repository was archived by the owner on Jun 6, 2025. It is now read-only.

Update model on insertNode #67

Description

@rschenkel

I created a custom plugin which adds a an element via the insertNode call. However, even though the editor's data is being updated the model is not. The code is similar to the below with the attributes and html set from an object.

var editorSelection = editor.getSelection();
var editorRange = editorSelection.getRanges()[0];
var newAnchor = new CKEDITOR.dom.element('a', editor.document);

newAnchor.setAttributes({
id: 'customId',
name: 'customName',
type: 'customType'
});
newAnchor.setHtml('customText');

editorRange.insertNode(newAnchor);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions