1
votes

I've managed to create a new Paragraph with style for sitecore rich editor by creating a new item under: /sitecore/system/Settings/Html Editor Profiles/Rich Text Default/Paragraphs/

The paragrah value is

enter image description here

Issue: For the first time when I select a section on RTE and click this new selection it successfully wraps with tag below:

<p class="something> paragrah...... </p>

However when I again select the same paragraph and select "Normal" style the above doesn't get replace with:

<p>paragraph..... </p>

If we reverse the above also doesn't work. Some reason RTE seems to think

<p class="something> is same as <p>`

Could someone help me whether this is a bug within RTE/Sitecore?

1
What version of SC are you on? In 6.5 with the Telerik RTE in default mode I don't see the option of selecting "Normal" style. - ToddB
I know this is quite old post but I am running into similar issue. I'm using Sitecore 9. Any ideas to resolve this problem or is it a Sitecore bug? - Natasha Batra

1 Answers

2
votes

I recently tried this and got similar results but was able to resolve what I think is perhaps a missing piece of what you're looking for.

I created a new paragraph test class in my core db called Test. I then opened a RTE and applied my test class. After, I saw that it had applied my class like yours above:

<p class="test">this is a test</p>

I immediately tried to apply the 'Normal' class over this and it didn't change the result. However, right next to the Paragraph classes dropdown, you'll see the dropdown next to it shows you the applied class to this paragraph. If you use that dropdown, it lets you 'Clear Class' on the element, effectively getting you back to a normal p tag.

For kicks, I went back to core and added a new class called test2. I gave it a new classname called Test2. Now back in my editor, I applied 'test' first and it again gave me:

 <p class="test">this is a test</p>

But when I applied 'test2' over it, I got this:

<p class="test2">this is a test</p>

So I think the confusion is no 'new' class is being applied, and it's not a stripping function, only an applying function. So to clear a class, you'll have to use the 'Clear Class' option in the drop down on the left.