RTE-Remove new line character before save event | Community
Skip to main content
Manjunath_DJ
Level 2
September 5, 2017
Solved

RTE-Remove new line character before save event

  • September 5, 2017
  • 6 replies
  • 3768 views

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.
Best answer by smacdonald2008

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

smacdonald2008
smacdonald2008Accepted solution
Level 10
September 5, 2017

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

Manjunath_DJ
Level 2
September 5, 2017

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.

smacdonald2008
Level 10
September 5, 2017

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

smacdonald2008
Level 10
September 5, 2017

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

Manjunath_DJ
Level 2
September 6, 2017

Thank you lot . I will look into this.

Manjunath_DJ
Level 2
September 13, 2017

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