Expand my Community achievements bar.

SOLVED

New line added when using context="html" in sightly

Avatar

Level 1

Hi All,

I am facing a really weird issue while trying to use context="html" in sightly.

I have a dialog property like this someproperty : "something<sub>2</sub>something"

HTML is <h1>${properties.someproperty @ context='html'}</h1>

Now, when rendered it adds a new line after the sub html tag. So it comes out as :

something2

something

I have tried few tags other than the sub tag as well and its the same behaviour for them as well.

The same thing works fine with context='unsafe'.

This is for AEM6.2 SP1. I have no idea whats wrong here ? 

1 Accepted Solution

Avatar

Correct answer by
Level 1

Hi All,

I found the problem. Posting the solution in case someone else lands on some similar problem.

The issue was we had an overridden xss config file in our AEM instance from one of the applications (multiple applications are deployed) i.e : /apps/cq/xssprotection/config.xml

Now this config had the following directive : <directive name="formatOutput" value="true"/>

which in turn causes some additional formatting and hence the line break. I changed it to : <directive name="formatOutput" value="false"/>

and everything worked fine. So in case, someone actually faces similar kind of issue, you know where to look :) 

View solution in original post

2 Replies

Avatar

Level 10

I tried on text field with value : something<sub>2</sub>something

and sightly: <h1>${properties.headline @ context='html'}</h1>

Output:

Works fine

Let me know If I am missing any point

Avatar

Correct answer by
Level 1

Hi All,

I found the problem. Posting the solution in case someone else lands on some similar problem.

The issue was we had an overridden xss config file in our AEM instance from one of the applications (multiple applications are deployed) i.e : /apps/cq/xssprotection/config.xml

Now this config had the following directive : <directive name="formatOutput" value="true"/>

which in turn causes some additional formatting and hence the line break. I changed it to : <directive name="formatOutput" value="false"/>

and everything worked fine. So in case, someone actually faces similar kind of issue, you know where to look :)