Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTE Containers/Code style doesn't work #17225

Closed
wwrobel opened this issue Oct 9, 2024 · 1 comment
Closed

RTE Containers/Code style doesn't work #17225

wwrobel opened this issue Oct 9, 2024 · 1 comment

Comments

@wwrobel
Copy link
Contributor

wwrobel commented Oct 9, 2024

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.

image

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

  1. Go to RTE property and type some text.
  2. Select the text and set the styling to Containers/Code as shown on the above screenshot.
  3. (Optional) Take a look on RTE html generated, there will be only the text surrounded by <p></p> instead of <p><code></code></p>.
  4. Save changes.
  5. 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"
      }
    }
  }
}
@iOvergaard
Copy link
Contributor

Fixed on the main branch. Will end up in the next release of V13, if there ever is one. I will transfer the fix to V14 and V15 as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants