RTE-Remove new line character before save event | Community
Skip to main content
Manjunath_DJ
Level 2
Sep 5, 2017 2:11 PM UTC
Solved

RTE-Remove new line character before save event

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
smacdonald2008
smacdonald2008Accepted solution
Level 10
Sep 5, 2017 2:13 PM UTC

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

6 replies

Manjunath_DJ
Level 2
Sep 13, 2017 1:59 PM UTC

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

Translate
Manjunath_DJ
Level 2
Sep 6, 2017 5:29 AM UTC

Thank you lot . I will look into this.

Translate
smacdonald2008
Level 10
Sep 5, 2017 4:40 PM UTC

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

Translate
smacdonald2008
Level 10
Sep 5, 2017 2:43 PM UTC

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 Plugin, Add Summary Field

Translate
Manjunath_DJ
Level 2
Sep 5, 2017 2:32 PM UTC

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.

Translate
smacdonald2008
smacdonald2008Accepted solution
Level 10
Sep 5, 2017 2:13 PM UTC

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

Translate