+ Start a Discussion

HTML tags and strings

I have the following code on a visualforce page:


<apex:outputText escape="false" >



Where description is a string in my component that is set as the following:



description = 'Description:<ul><li>Bullet Point</li></ul>';


Unfortunately the output on the screen is:

Description:<ul><li>Bullet Point</li></ul>

Where the h1 tags are working correctly, but anything that comes from the string value in the controller is displayed literally.  Is there any way to display the string as I'm hoping, with the list being displayed properly?





escape=false controls the text that is included by the value attribute of apex:outputText.  




<apex:outputText escape="false" value="{!description}"/>




As always when using escape=false, you should make sure you are not creating a security hole that would facilitate cross-site scripting.