@@ -59,7 +59,7 @@ This means that you need to inject the icons stylesheet into the `<iframe>`, so
5959@code {
6060 private string EditorValue { get; set; } = @"<p>Here is an example icon in the Editor content <i class='fa fa-info-circle'></i></p>";
6161
62- private List<IEditorTool> EditorTools { get; set; } = new List<IEditorTool>() { new ViewHtml() } ;
62+ private List<IEditorTool> EditorTools { get; set; } = EditorToolSets.All ;
6363
6464 protected override async Task OnAfterRenderAsync(bool firstRender)
6565 {
@@ -103,9 +103,13 @@ This means that you need to inject the icons stylesheet into the `<iframe>`, so
103103 const schema = args.getSchema();
104104 const Schema = args.ProseMirror.Schema
105105
106+ // remove the default i mark that does not support the class attribute
107+ let marks = schema.spec.marks.remove("i");
108+
109+ // add the modified i as a node
106110 let nodes = schema.spec.nodes.addToEnd("i", iconNode);
107111
108- const newSchema = new Schema({ nodes });
112+ const newSchema = new Schema({ nodes, marks });
109113 return newSchema;
110114 }
111115
@@ -155,7 +159,7 @@ Make sure to use the correct way and resources for your actual project *@
155159@code {
156160 private string EditorValue { get; set; } = @"Here is an example icon in the Editor content <i class='fa fa-info-circle'></i>";
157161
158- private List<IEditorTool> EditorTools { get; set; } = new List<IEditorTool>() { new ViewHtml() } ;
162+ private List<IEditorTool> EditorTools { get; set; } = EditorToolSets.All ;
159163}
160164
161165@* Move JavaScript code to a separate JS file in production *@
@@ -185,16 +189,19 @@ Make sure to use the correct way and resources for your actual project *@
185189 return ["i", attrs];
186190 },
187191 };
188- debugger
189192
190193 //add the icon node to the Editor ProseMirror schema
191194 window.schemaProvider = (args) => {
192195 const schema = args.getSchema();
193196 const Schema = args.ProseMirror.Schema
194197
198+ // remove the default i mark that does not support the class attribute
199+ let marks = schema.spec.marks.remove("i");
200+
201+ // add the modified i as a node
195202 let nodes = schema.spec.nodes.addToEnd("i", iconNode);
196203
197- const newSchema = new Schema({ nodes });
204+ const newSchema = new Schema({ nodes, marks });
198205 return newSchema;
199206 }
200207
@@ -204,4 +211,4 @@ Make sure to use the correct way and resources for your actual project *@
204211## See Also
205212
206213* [ Custom Editor Tools] ({%slug editor-custom-tools%})
207- * [ Modify the ProseMirror Schema] ({%slug editor-modify-default-schema%})
214+ * [ Modify the ProseMirror Schema] ({%slug editor-modify-default-schema%})
0 commit comments