Rich Text Editor (RTE) line breaks not retained after publish in AEM
In ÃÛ¶¹ÊÓÆµ Experience Manager as a Cloud Service (AEMaaCS) – Sites, the Universal Editor’s Rich Text Editor (RTE) removes line breaks added using Shift+Enter when content is published. These line breaks appear correctly in author preview but are stripped during the HTML transformation process to enforce semantic standards. To resolve the issue, use semantic HTML or update RTE configuration.
Description description
Environment
- Product: ÃÛ¶¹ÊÓÆµ Experience Manager as a Cloud Service (AEMaaCS) – Sites
- Feature: Universal Editor – Rich Text Editor (RTE)
- Environment: Staging
Issue / Symptoms
- Line breaks added using Shift+Enter display correctly in author preview.
- Published pages remove the inserted line breaks.
- Formatting appears inconsistent between author and published versions.
- Soft breaks (
<br>
) are stripped during HTML transformation. - Content layout and readability are negatively affected on the published page.
Resolution resolution
The AEM EDS Universal Editor includes a built-in Rich Text Editor (RTE) that generates semantic HTML for optimized delivery. During content transformation, it strips soft breaks inserted with Shift+Enter to produce clean, standards-compliant HTML. This behavior is intentional and aligns with AEM’s design.
To preserve line breaks and formatting, follow these workarounds:
- Structure content using
<p>
tags or containers styled with CSS properties like margin or padding to maintain visual spacing. - Update the RTE content policy to allow required HTML elements and prevent formatting overrides.
- Inspect client-side rendering logic on the published page and remove any scripts that strip
<br>
tags. - Use alternative markup or implement custom components to enforce specific formatting.