AEM6.5 source edit plugin adding "\r\n" after content adding in richtext inside Multifield | Community
Skip to main content
tushaar_srivastava
New Participant
January 5, 2023
Solved

AEM6.5 source edit plugin adding "\r\n" after content adding in richtext inside Multifield

  • January 5, 2023
  • 3 replies
  • 1249 views

Hi All,

the Source Edit Plugin is adding a "\r\n" line break after the content that you are authoring in a multifield dialog with richtext fields in Adobe Experience Manager (AEM).

 

I am facing an issue where I have a multifield dialog having richtext fields. and whenever I am authorthing any values using Source Edit Plugin. and saving dialog it will automatically save "\r\n" regex after the authored content init

example:

and store like : 

 

and if we check properties in crx node it shows one line break [enter] in porpery.

 

How to resolve this?

 

Thanks 

@kautuk_sahni  @arunpatidar @briankasingli  @theo_pendle 

 

[Update]
I am reading the richtext value with name.\value, which is having \r\n in the last of which we authored in source edit plugin and I am reading it like ValueMap vm = multifield.getValueMap; vm.getOrDefault("Value",StringUtils.EMPTY).toString()); I am manipulate the string to reove \r\n from the last : 
like: 

String value = vm.getOrDefault("Value", StringUtils.EMPTY).toString(); value = value.trim();

or

String value = vm.getOrDefault("Value", StringUtils.EMPTY).toString(); value = StringUtils.stripEnd(value, "\r\n");

Could you please suggest me any other optimized solution.

 

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

I have used below approach :

String value = vm.getOrDefault("Value", StringUtils.EMPTY).toString(); value = StringUtils.stripEnd(value, "\r\n");

3 replies

tushaar_srivastava
tushaar_srivastavaAuthorAccepted solution
New Participant
January 11, 2023

I have used below approach :

String value = vm.getOrDefault("Value", StringUtils.EMPTY).toString(); value = StringUtils.stripEnd(value, "\r\n");
kautuk_sahni
Employee
January 6, 2023
New Participant
January 5, 2023

Hi ,

 

similar question 

 

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/rte-remove-new-line-character-before-save-event/m-p/245428 

 

string = string.replaceAll("(\\r\\n|\\n|\\r)", "");

 

Thanks 

tushaar_srivastava
New Participant
January 6, 2023

do we have any dialog level property implementation to remove line break for richText>? maybe cleanup="true"