AEM Sightly - Special characters not displaying properly in view source for RTE | Adobe Higher Education
Skip to main content
Level 2
December 3, 2018
해결됨

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

  • December 3, 2018
  • 3 답변들
  • 2579 조회

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?

이 주제는 답변이 닫혔습니다.
최고의 답변: 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 답변

arunpatidar
Community Advisor
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.

angthefire작성자
Level 2
December 4, 2018

Thank you Arun. The solution works