2

The Strip Css Formatting option in Rich Text Editor does not remove all inline styles. Using the following markup:

<h3 style="color: #222222; background-color: #ffffff; margin: 1em 0px; padding: 0px; line-height: 1.3em;">Q: What is the outlook for the U.S. economy, as well as fiscal and monetary policy?</h3>
<p style="color:#ff0000; background-color: #000;"> HELLO </p>
<p style="color:#ffff00; background-color:#000;"> <span style="font-weight: bold; color: #ffffff;">jello </span></p>

Results in:

<h3>Q: What is the outlook for the U.S. economy, as well as fiscal and monetary policy?</h3>
<p> HELLO </p>
<p> <span style="color: #ffffff;">jello </span></p>

As you can see the last inline style was not stripped out. Is there any explanation for that behavior?

Sitecore version 10.1.

2
  • Sitecore version? Feb 9, 2022 at 14:04
  • @JonKoivula 10.1. I have updated it in the description. Thanks. Feb 9, 2022 at 14:25

1 Answer 1

3

This is standard behavior of Telerik RTE I'm afraid.

color attribute from <span> tags is never removed.

You can check that on online demo page of Telerik RTE: https://demos.telerik.com/aspnet-ajax/editor/examples/overview/defaultcs.aspx

Switch to html mode there, paste your html and try clearing content - you will see that you can remove all other styles, but color on <span> will never be removed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.