AEM 6.1 | Escape special chars in Sightly

Avatar

Avatar

CQ_learner

Avatar

CQ_learner

CQ_learner

30-06-2016

Hi All,

I want to escape chars like "<", ">" and "/" in sightly. I have this piece of code:

${"{1}{0}{2}{1}{3}{0}{2}" @ format=[properties.test,'<','>','/']} - but its rendering in HTML as &lt;test-data&gt;&lt;/contact-us&gt;

I checked this  https://docs.adobe.com/docs/en/aem/6-0/develop/sightly/expression-language.html  but could not solve the issue.

So How do I achieve this in Sightly? I bascially need a html tag - <test></test> , where "test" will be from dialog.

 

Thanks!!

View Entire Topic

Avatar

Avatar

CQ_learner

Avatar

CQ_learner

CQ_learner

30-06-2016

Hi Kautuk,

Thanks for the reply, I am able to create the String with <text></text>,But the issue is I need to convert this into a html tag and not as a text or string. It should appear in the DOM and not in the page.

Thanks!