Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

RTE-Remove new line character before save event

Avatar

Level 2

Hi ,

I have to parse the RTE(Rich Text Editor) content data before saving for example needed to remove some new line(\n) and carriage return(\r)  characters before save.

Please advice.smacdonald2008

Thanks,

Manjunath DJ

1 Accepted Solution

Avatar

Correct answer by
Level 10

I would use it within a HTL component and read the RTE value in Java and then manipulate it using a Java API.

View solution in original post

6 Replies

Avatar

Correct answer by
Level 10

I would use it within a HTL component and read the RTE value in Java and then manipulate it using a Java API.

Avatar

Level 2

Hi smacdonald2008

I need to store the values back to crx with formatted data.since we are accessing the for json format for service purpose.

Avatar

Level 10

If you want to modify before reading it - I recommend looking through this blog to see if he has written a blog on how to modify the content using  JS/plug-in. Something similar to this one:

Experiencing Adobe Experience Manager - Day CQ: AEM 61 - Extend TouchUI Rich Text Editor Table Plugi...

Avatar

Level 10

Some internal ppl recommended that you also look here:

Yes – a modified version of this should help

https://github.com/Adobe-Consulting-Services/acs-aem-commons/pull/546

Avatar

Level 2

Thank you lot . I will look into this.

Avatar

Level 2

While parsing the RTE data in JSON from java newline characters are converted to '\n' so as suggested reading the RTE value in Java and then manipulate it using a Java API works fine.

Thanks,

Manjunath DJ