AEM 6.3 SP2 - Replace <b> with <strong> and <i> with <em> in Rich Text Editor | Community
Skip to main content
Level 1
May 14, 2018

AEM 6.3 SP2 - Replace <b> with <strong> and <i> with <em> in Rich Text Editor

  • May 14, 2018
  • 2 replies
  • 9968 views

Hi All,

I want to replace <b> with <strong> and <i> with <em> in rte in AEM 6.3 SP2. I already tried below solutions but no luck as they all are for AEM 6.1.

1. Experiencing Adobe Experience Manager - Day CQ: AEM 61 - Touch UI Rich Text Editor Remove Bold and Add Strong Plugin

2. Overriding '/libs/clientlibs/granite/richtext/core/js/commands/DefaultFormatting.js' with <b> to <strong>

3. Adding 'semanticMarkupMap' node in rte for changing of <b> to <strong>.

Whenever i author rte in dialog, it changes <b> to <strong> but the moment i click ok or 'view Source', it changes back to <b>.

Can you please provide some inputs?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

smacdonald2008
Level 10
May 14, 2018

Did you follow this article exactly - enter all of the plug-in code?

smacdonald2008
Level 10
May 14, 2018

Also - we are checking with the author to see if there is an updated version of this article.

PushparajanR
August 6, 2018

We are also facing same issue. Any solution available now?

FredrickDominy
June 13, 2018

I've had luck with adding this as a sibling to the RTE dialog's <uiSettings> and <rtePlugins> nodes.

<htmlRules jcr:primaryType="nt:unstructured">
  <docType jcr:primaryType="nt:unstructured">
  <typeConfig jcr:primaryType="nt:unstructured"
   useSemanticMarkup="{Boolean}true">
  <semanticMarkupMap
   b="strong"
   i="em"/>
  </typeConfig>
  </docType>
</htmlRules>

Note that if text has already been authored with <b> and <i> tags you will need to go in and add a space somewhere in the rte editor to pick up the change and swap the tags.

Level 2
September 1, 2018

Fedrick,

<semanticMarkupMap
   b="strong"
   i="em"/>

shouldn't it be

<typeConfig jcr:primaryType="nt:unstructured"

   useSemanticMarkup="{Boolean}true">

  <semanticMarkupMap jcr:primaryType="nt:unstructured"

   b="strong"

   i="em"/>

</typeConfig>

not sure, how without jcr:primaryType="nt:unstructured" we can enter the value.

Please clarify.. I tried it as a node, but still not working... Im on AEM 6.4

rk_pandian
Level 4
March 11, 2022

Hi,

In 6.5 SP4, I have tried all the mentioned solutions without having success. If anyone got a solution in 6.5 sp please put it here.


Hi @jakecham ,

 

Can you pls try to refer/map the <htmlRules> node created to the respective RTE field in your dialog? because this helped me fix the issue in 6.5.

 

Let me know if it helps 🙂

 

<richTextContent
jcr:primaryType="nt:unstructured"
sling:resourceType="cq/gui/components/authoring/dialog/richtext"
fieldDescription="Enter content to be displayed"
fieldLabel="Rich text content"
name="./richTextContent"
useFixedInlineToolbar="{Boolean}true">
<rtePlugins
jcr:primaryType="nt:unstructured"
sling:resourceSuperType="/apps/<path to config>/rtePlugins"/>
<uiSettings
jcr:primaryType="nt:unstructured"
sling:resourceSuperType="/apps/<path to config>/uiSettings"/>
<htmlRules
jcr:primaryType="nt:unstructured"
sling:resourceSuperType="/apps/<path to config>/htmlRules"/>