Hi Ym,
To resolve this issue, we recommend setting the EnableHtmlSanitizer property to false into preview, which will allow you to add raw HTML and ensure that the styles are properly applied in the preview. Please note that by default, EnableHtmlSanitizer is set to true to avoid cross-scripting site attacks.
To implement this solution, please use the following code:
<SfRichTextEditor EnableHtmlSanitizer="false> </SfRichTextEditor> |
We have also attached a sample for your reference. You can find more information about EnableHtmlSanitizer in our API documentation, which is available at this
link: https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.SfRichTextEditor.html#Syncfusion_Blazor_RichTextEditor_SfRichTextEditor_EnableHtmlSanitizer
If you prefer not to disable the EnableHtmlSanitizer property for the preview, you can always add your styles into the application end.
Regards,
Vinothkumar
Attachment:
BlazorApp1_c3416877_2904a40c.zip