RTE editor... Editing the text ?

Hi there,

Got a little problem with the WYSIWYG RTE in Xperience.

Our client need to use some nbsp.

First, I had a problem with Froala editing the HTML we're inputing. I quickly found [this](https://froala.com/wysiwyg-editor/docs/options/#htmlUntouched) configuration that allows for froala to keep it's place and do what it's told.

And now... It's Kentico's turn. I have this in the CMS

It's correctly stored in DB
```

{
  "identifier": "b8336a8a-a877-4a29-b61f-a4701669ff7c",
  "type": "Kentico.Widget.RichText",
  "variants": [
    {
      "identifier": "005d3966-971f-4086-94c9-9ad5ea235cb8",
      "properties": {
        "content": "<p>1&nbsp;000&nbsp;000&nbsp;000 000</p>"
      },
      "fieldIdentifiers": {
        "content": "cf8f3585-4b26-4602-85f2-7f415aa5ebe1"
      }
    }
  ]
}

```

And here is how it's sent on the page (suppose to have an image showing the nbsp have been stripped from the HTML served by the server but...)

Not very WYSIWYG.

Is there a way to avoid Kentico modifying what it's told to display ?


Environment

  • Xperience by Kentico version: [31.2.0]

  • .NET version: [10]

Tags:
Page Builder Xperience Administration v31.2.0

Answers

Hi CDumange,

From the example you've shared, the content is being stored in the database with the &nbsp; entities intact, but the rendered output contains regular spaces.

The Rich Text Editor uses an HTML sanitizer to clean and filter HTML content. The sanitizer comes with a predefined set of allowed tags and attributes, which can be extended through the Settings → Rich Text Editor → Custom HTML attributes and tags settings.

One thing to note is that these settings are intended for HTML tags and attributes. Since &nbsp; is an HTML entity rather than a tag or attribute, adding it there would not affect how it is handled.

If you'd like to explore this further, it may be worth looking into Rich Text Editor customization options, as it provides additional flexibility around editor behavior and allowed HTML markup. This is something worth investigating further depending on the exact requirement.

For more information, you can refer to:

Hope that helps.

To response this discussion, you have to login first.