RadzenHtmlEditor tools add unwanted <span> #1438

Open
opened 2026-01-29 17:53:40 +00:00 by claunia · 0 comments
Owner

Originally created by @RickdeBruijn on GitHub (Oct 17, 2024).

Describe the bug
Im using the RadzenHtmlEditor, a few of the editor tools seem to add unwanted HTML tags to the value.
specifically this span tag:
<span style="background-color: var(--rz-editor-content-background-color);">

This seems to happen with at least the following tools:

  • align center
  • align right
  • ordered list

The bug is consistent on the first edit; however, if you remove the span after that first edit, it seems to keep working.

To Reproduce
I created a new Blazor solution in Visual Studio and added the RadzenHTMLEditor to the home page.
In this new project, the problematic span tag contains even more unwanted text.
the small test project:
[BlazorApp1 (3).zip] (https://github.com/user-attachments/files/17413382/BlazorApp1.3.zip)

  1. Launch app
  2. Type your text.
  3. Click the "align center button." 
  4. the value changes to:
    <div style="text-align: center;"><span style="background-color: var(--rz-editor-content-background-color); color: var(--bs-body-color); font-size: var(--bs-body-font-size); font-weight: var(--bs-body-font-weight); text-align: var(--bs-body-text-align);">Hello world</span></div>

Expected behavior
Clicking, for example, "align center" should only result in:
<div style="text-align: center;">HelloWorld</div>

Screenshots
The bug happening in my original app
image

The bug is happening in my test project (BlazorApp1).
image

Desktop:

  • OS: Windows
    Browser chrome
    Version 130.0.6723.59

Additional context

Originally created by @RickdeBruijn on GitHub (Oct 17, 2024). **Describe the bug** Im using the RadzenHtmlEditor, a few of the editor tools seem to add unwanted HTML tags to the value. specifically this span tag: `<span style="background-color: var(--rz-editor-content-background-color);">` This seems to happen with at least the following tools: - align center - align right - ordered list The bug is consistent on the first edit; however, if you remove the span after that first edit, it seems to keep working. **To Reproduce** I created a new Blazor solution in Visual Studio and added the RadzenHTMLEditor to the home page. In this new project, the problematic span tag contains even more unwanted text. the small test project: [BlazorApp1 (3).zip] (https://github.com/user-attachments/files/17413382/BlazorApp1.3.zip) 1. Launch app 2. Type your text. 3. Click the "align center button."  4. the value changes to: `<div style="text-align: center;"><span style="background-color: var(--rz-editor-content-background-color); color: var(--bs-body-color); font-size: var(--bs-body-font-size); font-weight: var(--bs-body-font-weight); text-align: var(--bs-body-text-align);">Hello world</span></div>` **Expected behavior** Clicking, for example, "align center" should only result in: `<div style="text-align: center;">HelloWorld</div>` **Screenshots** The bug happening in my original app ![image](https://github.com/user-attachments/assets/5b442207-6f2b-4880-8194-973d08cef223) The bug is happening in my test project (BlazorApp1). ![image](https://github.com/user-attachments/assets/276eed38-5234-490e-9796-d90103544a38) **Desktop:** - OS: Windows Browser chrome Version 130.0.6723.59 **Additional context**
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#1438