I have an apex apex:outputtext
used in VF page with escape="true"
. Setting escape = true shows the html entities instead of displaying the required html format. As the code is in managed package this should be XSS free using either escape=true or using HTMLENCODE VF function. Making XSS free makes the field to show the html entities.
For example
Controller:
String htmlString = '<p>Hello World</p>';
VF Page:
<apex:outputtext escape="true" value="{!htmlString }"/>
or just:
{!HTMLENCODE(htmlString )}
will give the output:
<p>Hello World<p>
Expected result is <p>Hello World</p>
. So how to get this output with XSS fix?