Issue with Double Curly Braces "{{" in Rich Text Field After LTS Upgrade – Incorrect Data Saved in CRX | Community
Skip to main content
Level 1
February 3, 2026

Issue with Double Curly Braces "{{" in Rich Text Field After LTS Upgrade – Incorrect Data Saved in CRX

  • February 3, 2026
  • 1 reply
  • 24 views

After upgrading to the latest LTS version of AEM, we have encountered an issue with the Rich Text field using the resource type cq/gui/components/authoring/dialog/richtext. When saving any sentence containing two consecutive curly braces {{, the data is not being stored correctly in CRX. Specifically, the double curly braces are being replaced with {<!-- -->{, which causes problems when the final HTML is generated.

Steps to Reproduce:

Open a dialog with a Rich Text field (cq/gui/components/authoring/dialog/richtext).
Enter the following content:
<p>{{someData['someData']}}</p>
Save the dialog.
Check the value stored in CRX.
Expected Result: The data should be saved as entered:
<p>{{ContentBlock['chaseContactUsFooter']}}</p>

Actual Result: The data is saved as:
<p>{<!-- -->{someData['someData&#39;]}}</p>

This unexpected replacement of {{ with {<!-- -->{ is causing issues in the rendered HTML and breaking our templating logic.



This issue occurs specifically on components placed within Experience Fragments and Templates.
The data is only modified after saving the dialog for the second time. On the first save, the data remains as entered, but after opening the dialog again and saving (even without making changes), the double curly braces are replaced.
Screenshot of the CRX repository showing the value before and after the second save (with timestamp for reference)

1 reply

PGURUKRISHNA
Level 4
February 3, 2026

Hey ​@SnehanjanaRa

Fix for Double Curly Braces Issue

Create this OSGi configuration file:

Path: 

ui.config/src/main/content/jcr_root/apps/wknd/osgiconfig/config.author/com.adobe.granite.xss.impl.XSSFilterImpl.cfg.json
{
"checkContentType": false
}

 

OR

If the above doesn't work, create:

Path: 

ui.config/src/main/content/jcr_root/apps/wknd/osgiconfig/config.author/org.apache.sling.rewriter.impl.HtmlParserFactory.cfg.json
{
"feature-preserve-cdata": true
}

CopyInsert at cursorjson

After adding the file:

  1. Build and deploy: 

    mvn clean install -PautoInstallPackage
  2. Restart AEM author instance

  3. Clear browser cache

  4. Re-save your content

This will prevent 

{{

 from being transformed to 

{<!-- -->{

.

Level 1
February 3, 2026

Hi ​@PGURUKRISHNA

Thanks for reaching out, tried with your suggested configs. Still same issue while resaving the dialog for the 2nd time.

PGURUKRISHNA
Level 4
February 5, 2026

@SnehanjanaRa The issue occurs because AEM's Sling Rewriter processes content on save and treats 

{{

 as unsafe. Here's the fix:

Solution 1: Disable Rewriter for Experience Fragments (Recommended)

Create this file in your 

ui.apps

 module:

Path

ui.apps/src/main/content/jcr_root/apps/[your-app]/config/rewriter/no-rewrite/.content.xml
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="nt:unstructured"
enabled="{Boolean}false"
paths="[/content/experience-fragments,/conf]"/>

 

Solution 2: Configure HTML Parser (If Solution 1 doesn't work)

Path

ui.config/src/main/content/jcr_root/apps/[your-app]/osgiconfig/config.author/org.apache.sling.rewriter.impl.HtmlParserFactory.cfg.json
{
"feature-namespaces": false,
"feature-validation": false
}

 

Solution 3: Use Custom RTE XSS Context

In your component's HTL file, change from:

${properties.text @ context='html'}

 

To:

${'<p>' @ context='unsafe'}${properties.text @ context='text'}${'</p>' @ context='unsafe'}

 

Or if you control the content source:

${properties.text @ context='unsafe'}

 

Solution 4: Store as Plain Text Property

In your component dialog, add this to the RTE field configuration:

<text
jcr:primaryType="nt:unstructured"
sling:resourceType="cq/gui/components/authoring/dialog/richtext"
name="./text"
useFixedInlineToolbar="{Boolean}true">
<rtePlugins jcr:primaryType="nt:unstructured">
<misctools jcr:primaryType="nt:unstructured">
<features jcr:primaryType="nt:unstructured">
<sourceedit
jcr:primaryType="nt:unstructured"
features="*"/>
</features>
</misctools>
</rtePlugins>
<valueType>text/html</valueType>
</text>

 

 

Then add 

valueType

 property: 

text/plain

Quick Test: After deploying, clear CRX cache by restarting AEM or going to 

/system/console/bundles

 and refreshing the Sling Rewriter bundle.

Root Cause: The second save triggers the rewriter pipeline which sanitizes 

{{

 to 

{<!-- -->{

 to prevent template injection attacks.