Xhtml Validation
14 Mar 20251 minute to read
The Rich Text Editor includes an EnableXhtml
property that allows for continuous validation of the Rich Text Editor’s source content against the XHTML standard. When content is entered or modified in the editor, this feature ensures ongoing compliance by automatically removing invalid elements and attributes.
The Rich Text Editor checks the following settings on validation:
Validating Attributes
- Case Sensitivity: All attributes must be in lowercase.
- Quotation Marks: Proper use of quotation marks around attribute values is enforced.
- Validity: Only valid attributes for corresponding HTML elements are allowed.
- Required Attributes: All required attributes for HTML elements must be included.
Validating HTML Elements
- Case Sensitivity: All HTML tags must be in lowercase.
- Proper Closing: All opening tags must have corresponding closing tags.
- Element Validity: Only valid HTML elements are permitted.
- Nesting: Elements must be properly nested to maintain structure.
- Root Element: The content must have a single root element.
- Element Hierarchy: Inline elements cannot contain block elements.
@using Syncfusion.Blazor.RichTextEditor
<div class="control-section">
<SfRichTextEditor EnableXhtml="true">
<p>Rich Text Editor allows to insert images from online source as well as local computer where you want to insert the image in your content.</p>
<p><b>Get started Quick Toolbar to click on the image</b></p>
<p>It is possible to add custom style on the selected image inside the Rich Text Editor through quick toolbar.</p>
</SfRichTextEditor>
</div>
NOTE
You can refer to our Blazor Rich Text Editor feature tour page for its groundbreaking feature representations. You can also explore our Blazor Rich Text Editor example to know how to render and configure the rich text editor tools.