Issue with Double Curly Braces "{{" in Rich Text Field After LTS Upgrade – Incorrect Data Saved in CRX
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']}}</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)