AEM Sightly - Special characters not displaying properly in view source for RTE | Community
Skip to main content
Level 2
December 3, 2018
Solved

AEM Sightly - Special characters not displaying properly in view source for RTE

  • December 3, 2018
  • 3 replies
  • 2579 views

Hi Team,

I have a requirement where user inputs <%= formatDate(new Date(), "%2D.%2M.%4Y") %> in RTE.

If I check the view page source, the data is rendered as &lt;%= formatDate(new Date(), &quot;%2D.%2M.%4Y&quot;) %&gt;

Desired result is <%= formatDate(new Date(), "%2D.%2M.%4Y") %>

I tried adding context = 'unsafe' but it is not working for RTE although the context works like a charm for textfield or pathfield.

Is there a way to get the expected result in RTE as well?

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 arunpatidar

Hi,

I think when user input text in RTE , the character encoding is applied thats why your function is traded as text.

What you can do, you can read RTE text value using java and decode and return in HTL.

3 replies

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
December 3, 2018

Hi,

I think when user input text in RTE , the character encoding is applied thats why your function is traded as text.

What you can do, you can read RTE text value using java and decode and return in HTL.

Arun Patidar
smacdonald2008
Level 10
December 3, 2018

Arun's response is correct.

Level 2
December 4, 2018

Thank you Arun. The solution works