Merge pull request #1883 from leigh-pointer/RichTextContent

Rework to #1848 RawHTML not being saved
This commit is contained in:
Shaun Walker 2021-12-16 15:37:14 -05:00 committed by GitHub
commit bf56c2a9fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -120,19 +120,20 @@
new Resource { ResourceType = ResourceType.Script, Bundle = "Quill", Url = "js/quill-interop.js" }
};
protected override void OnParametersSet()
protected override async Task OnParametersSetAsync()
{
_content = Content; // raw HTML
await RefreshRichText();
}
protected override async Task OnAfterRenderAsync(bool firstRender)
{
var interop = new RichTextEditorInterop(JSRuntime);
if (firstRender)
var interop = new RichTextEditorInterop(JSRuntime);
if (firstRender)
{
await base.OnAfterRenderAsync(firstRender);
await interop.CreateEditor(
_editorElement,
_toolBar,
@ -140,15 +141,14 @@
Placeholder,
Theme,
DebugLevel);
await interop.LoadEditorContent(_editorElement, Content);
_content = Content; // raw HTML
}
await interop.LoadEditorContent(_editorElement, Content);
_content = Content; // raw HTML
// 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);
// 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);
}
public void CloseFileManager()