The Syncfusion® native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I have implemented the richtext editor from you and I send the content to an interface to the backend of our application. This interface checks the content (alos the string) against an XML schema, which only allows the following HTML tags without style attributes:
*<p>
*<strong>
*<h4>
*<em>
*<ul>
*<ol>
*<li>
*<dl>
*<dt>
*<dd>
Is there a way to tell the component to use only the HTML tags listed above?
VJVinitha Jeyakumar Syncfusion Team February 7, 2024 07:38 AM UTC
Hi Denis Kirchner,
Your requirement to restrict some set of HTML tags from the RichTextEditor can be achieved by using the beforeSanitizeHtml event arguments, where you can add the tags which you want to avoid within the Editor and also to restrict Html tags while pasting contents into the Editor can be achieved by using the deniedTags property in pasteCleanupSettings. Please check the code and sample below,
Code snippet:
<ejs-richtexteditor
id="defaultRTE"
(beforeSanitizeHtml)="beforeSanitizeHtml($event)"
[pasteCleanupSettings]="pasteCleanupSettings"
>
</ejs-richtexteditor>
publicbeforeSanitizeHtml(args) {
// here we have denied <a> tag for your example and
you can add all the tags here to restrict like below,
thank you for your quick reply and for your code example. I will try it out in the next few days. If it doesn't work, I will share the code of the shared component (in coordination with the team).
Best regards
Denis
VJVinitha Jeyakumar Syncfusion Team February 9, 2024 04:37 AM UTC
Hi Denis Kirchner,
Sure, We will wait until we get an update from you.
Regards,
Vinitha
Need More Help?
Get personalized assistance from our support team.