public async Task RefreshRawHtml() { var interop = new RichTextEditorInterop(JSRuntime); _content = await interop.GetHtml(_editorElement); StateHasChanged(); }
public async Task <string> GetHtml() { // get rich text content var interop = new RichTextEditorInterop(JSRuntime); string content = await interop.GetHtml(_editorElement); if (_original != content) { // rich text content has changed - return it return(content); } else { // return raw html content return(_content); } }
protected override async Task OnAfterRenderAsync(bool firstRender) { if (firstRender) { await base.OnAfterRenderAsync(firstRender); var interop = new RichTextEditorInterop(JSRuntime); await interop.CreateEditor( _editorElement, _toolBar, ReadOnly, Placeholder, Theme, DebugLevel); await interop.LoadEditorContent(_editorElement, Content); // preserve a copy of the rich text content ( Quill sanitizes content so we need to retrieve it from the editor ) _original = await interop.GetHtml(_editorElement); } }