-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Description
Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)
13.5.1
Bug summary
When you select the Code "Container" from the dropdown in the RTE (see screenshot), the styling is initially applied but removed again when saving.
Specifics
The code should be surrounded by the <code></code> block, but it isn't.
The cause is that <code> element isn't added as valid HTML element in RTE configuration
Steps to reproduce
- Go to RTE property and type some text.
- Select the text and set the styling to
Containers/Codeas shown on the above screenshot. - (Optional) Take a look on RTE html generated, there will be only the text surrounded by
<p></p>instead of<p><code></code></p>. - Save changes.
- Code text in RTE will be surrounded only by
<p></p>, so code style won't be applied.
Expected result / actual result
Code text should be surrounded by <p><code></code></p>. To make it works we should add the code into valid elements here.
There is a simple workaround for that issue. You can add the <code> html element as valid through the RTE custom configuration by extending appsettings.json:
"Umbraco": {
"CMS": {
"RichTextEditor": {
"CustomConfig": {
"extended_valid_elements": "code"
}
}
}
}
This item has been added to our backlog AB#47421
Reactions are currently unavailable
