The available command setHTML replaces the existing content. Is there any way to insert HTML content at specific position as insertText.
After long research I found that currently there is no built-in way to get this done. However there is a workaround provided at Telerik forums.
Forum link: insert-html-content-to-editor
Example
public insertHTML(editor: EditorComponent) {
editor.exec('insertText', { text: '#CURSOR#' });
// Replace cursor placeholder with new HTML and set the new editor value.
editor.value = editor.value.replace(/#CURSOR#/, this.strResult);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With