diff --git a/knowledge-base/editor-add-icons.md b/knowledge-base/editor-add-icons.md new file mode 100644 index 000000000..1262b4407 --- /dev/null +++ b/knowledge-base/editor-add-icons.md @@ -0,0 +1,207 @@ +--- +title: Add Font Icons in Editor +description: How to insert tags in the Editor for Blazor to render custom icons in the Editor content? +type: how-to +page_title: How to Add Font Icons in the Telerik Editor for Blazor +slug: editor-kb-add-icons +position: +tags: blazor, editor, prosemirror, schema, icon +ticketid: +res_type: kb +--- + +## Environment + + + + + + + +
ProductEditor for Blazor
+ + +## Description + +This KB article answers the following questions: + +* How to add custom icons in the Editor content? When adding an icon such as ``, the icon's HTML disappears upon saving. +* How can I add an `` element inside the Editor? + +## Solution + +The default schema of the Telerik Editor does not include an `` tag, so the Editor strips such elements automatically. To allow adding font icons through `` tags in the Editor content: + +1. [Modify the ProseMirror schema]({%slug editor-modify-default-schema%}) to include a node for the `` element. +2. Ensure the required font icon stylesheets can affect the Editor content. The approach varies depending on the [edit mode of the Editor]({%slug editor-edit-modes-overview%}): + * [Iframe Edit Mode](#add-icons-in-iframe-edit-mode) + * [Div Edit Mode](#add-icons-in-div-edit-mode) + + +### Add Icons in Iframe Edit Mode + +When the [Editor `EditMode` is set to `EditorEditMode.Iframe`]({%slug editor-edit-modes-iframe%}), the content area is inside an `