Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

RTE style - remove/disable span generation

Avatar

Level 2

Hi community,

 

We are running aem 6.5 SP8, will be upgrading to 12 shortly. 

Is there any way to disable the span generation when using RTE styles? I mean some OOTB way of doing things, we are aware we can create a custom plugin for styles that would do the same thing, but I am trying to see if we can override the OOTB options.

Current:

<h2> <span class="some-class"> some text </span></h2>

Expected:

<h2 class="some-class"> some text </h2>

Thanks in advance.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

OOTB this is not possible.

You can create a custom plugin that adds class directly to h2.

 



Arun Patidar

View solution in original post

3 Replies

Avatar

Community Advisor

For removing the <p> tag we have to create a node named htmlRules having jcr:primary type nt:unstructured. This node will have to create under the widget node which xtype is richtext.

AnmolBhardwaj1808_0-1652164911809.png

jcr:primaryType = “nt:unstructured”

removeSingleParagraphContainer = “{Boolean}true”.

Avatar

Level 2

Yeah, I have seen that p tag can be removed in this way. Was hoping for something similar for span tag.

Avatar

Correct answer by
Community Advisor

Hi,

OOTB this is not possible.

You can create a custom plugin that adds class directly to h2.

 



Arun Patidar