Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Richtext - customize b tag into strong tag

davidef34326447
Level 3
Level 3

Hi community,

 

in aem 6.5, how can i customize bold <b> tag into <strong>?

i have tried with:

<htmlRules jcr:primaryType="nt:unstructured">
<docType jcr:primaryType="nt:unstructured">
<typeConfig jcr:primaryType="nt:unstructured">
<semanticMarkupMap jcr:primaryType="nt:unstructured"
strong="b"/>
</typeConfig>
</docType>
</htmlRules>

but it seems that the replacement is random (not stable). sometime it's work and sometime no. debugging the clientlibs: /libs/clientlibs/granite/richtext.js i saw the "deprecated" word:

davidef34326447_0-1630081741029.png

and during the 

this.elementsToChange = clear(this.elementsToChange);

the list sometime is 0 and other time is correctly catched!

 

davidef34326447_1-1630081835398.png

 

What i'm wrong? my suspect is related to the "<strong>" tag acceptance.. seems that from this customization the tag is replaced and from another side, the tag is converted againt into <b>.

 

tks,

 

 

 

 

 

 

1 Accepted Solution
Asutosh_Jena_
Correct answer by
Community Advisor
Community Advisor

Hi @davidef34326447 

 

Did you try adding the below code? It works perfectly fine for me on AEM 6.5.9.0. It works in any AEM 6.5 version as I am using it from 6.5.3.0 onwards.

 

<htmlRules jcr:primaryType="nt:unstructured">
<docType jcr:primaryType="nt:unstructured">
<typeConfig
jcr:primaryType="nt:unstructured"
isXhtmlStrict="{Boolean}true"
useSemanticMarkup="{Boolean}true"/>
</docType>
</htmlRules>

 

Thanks! 

View solution in original post

2 Replies
Asutosh_Jena_
Correct answer by
Community Advisor
Community Advisor

Hi @davidef34326447 

 

Did you try adding the below code? It works perfectly fine for me on AEM 6.5.9.0. It works in any AEM 6.5 version as I am using it from 6.5.3.0 onwards.

 

<htmlRules jcr:primaryType="nt:unstructured">
<docType jcr:primaryType="nt:unstructured">
<typeConfig
jcr:primaryType="nt:unstructured"
isXhtmlStrict="{Boolean}true"
useSemanticMarkup="{Boolean}true"/>
</docType>
</htmlRules>

 

Thanks! 

View solution in original post

Vijayalakshmi_S
Community Advisor
Community Advisor

Hi @davidef34326447,

The culprit is markup map node which says to map strong as b(strong="b") instead of b to strong(b="strong")

You can update the typeConfig node as @Asutosh_Jena_ mentioned and remove the semanticmarkupMap node