Documentation
Insertion
insertBreakline
Inserts the br tag at the caret.
this.app.insertion.insertBreakline();
insertHtml
html | String |
Inserts html at the caret. This method is used for inserting inline html. In other cases you should use editor.inserContent
.
this.app.insertion.insertHtml('<span>HTML</span>');
this.app.insertion.insertHtml(' ');
insertNode
element | Node , Element , Dom | |
caret (optional) | String |
Inserts a node at caret.
// create node
var node = document.createElement('img');
node.src = 'image-url';
// insert
this.app.insertion.insertNode(node);
You can specify a caret position after inserting the node.
this.app.insertion.insertNode(node, 'end');
this.app.insertion.insertNode(node, 'start');
this.app.insertion.insertNode(node, 'after');
this.app.insertion.insertNode(node, 'before');
dkjgvo65776inru43654