RTE style - remove/disable span generation | Community
Skip to main content
Level 2
May 9, 2022 8:34 PM UTC
Solved

RTE style - remove/disable span generation

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
arunpatidar
arunpatidarAccepted solution
New Participant
May 10, 2022 7:39 AM UTC

Hi,

OOTB this is not possible.

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

 

Arun Patidar

3 replies

arunpatidar
arunpatidarAccepted solution
New Participant
May 10, 2022 7:39 AM UTC

Hi,

OOTB this is not possible.

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

 

Translate
Arun Patidar
Anmol_Bhardwaj
New Participant
May 10, 2022 6:42 AM UTC

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.

jcr:primaryType = “nt:unstructured”

removeSingleParagraphContainer = “{Boolean}true”.
Translate
mitadianaAuthor
Level 2
May 10, 2022 9:43 AM UTC

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

Translate