Hi Team
When inputting a newline character (\n) in any text field of an AEM content fragment, the JSON output shows \\n instead of \n. This leads to inconsistencies, as the UI displays the newline correctly, but the JSON response doesn't reflect the intended formatting
How to address this any advise.
Thanks in advance.
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @Prashardan ,
Use multi-value rich text property for updating the special characters in the CF field.
Just enter the content in new line in CF field. In the JSON it appends /n on it's own when rich text property used like below -
Hope this helps
Thanks
Hi @Prashardan ,
Use multi-value rich text property for updating the special characters in the CF field.
Just enter the content in new line in CF field. In the JSON it appends /n on it's own when rich text property used like below -
Hope this helps
Thanks
To handle newline characters (\n) properly in AEM Content Fragments, you can use a multi-value rich text property. When you enter content with line breaks in the Content Fragment field, AEM will automatically encode it with \n for line breaks.
Solution:
1. Use Multi-value Rich Text Property: This allows AEM to handle newline characters properly when the content is entered in the field.
2. Behavior: When using this property, you can enter the content with new lines, and AEM will ensure that \n appears in the JSON output instead of \\n.