Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kendo Angular Editor setHTML: Insert HTML Content at specific position or after cursor

The available command setHTML replaces the existing content. Is there any way to insert HTML content at specific position as insertText.

like image 884
Ganesh Matkam Avatar asked Feb 27 '26 11:02

Ganesh Matkam


1 Answers

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);
}
like image 178
Ganesh Matkam Avatar answered Mar 02 '26 00:03

Ganesh Matkam