New to Kendo UI for Angular? Start a free 30-day trial
Inserting an HTML hr Tag in the Editor Content
Updated over 6 months ago
Environment
| Product | Progress® Kendo UI® for Angular Editor |
Description
How to insert an HTML hr tag in the content of the Editor?
Solution
To insert an HTML hr tag in the content of the Editor:
-
Handle the
clickevent of theToolbarButtonComponent.html<kendo-toolbar-button (click)="insertHr(editor)" ...></kendo-toolbar-button> -
Utilize the built-in
execfunction of the Editor and add some unique text by using its insertText command.tseditor.exec('insertText', { text: '#CURSOR#' }); -
Replace the text with the
hrtag.tseditor.value = editor.value.replace(/#CURSOR#/, '<hr>');
The following example demonstrates how to implement the suggested approach and insert an hr tag inside the Editor component.
Change Theme
Theme
Loading ...