function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jtranjtran 

How to set a column to be html-aware?

Hi,

I'm writing a visualforce page that displays the email messages associated with a support case. One of the column of my page contains the email body. Since many of the emails contain html data so I'm using the htmlbody field from the EmailMessage object because the textbody field contains no line-breaks so the text is all lumped together. 

How do I display the html text properly or at least preserving the line break/carriage returns so that the column's text is readable? Thanks,

 

James

David VPDavid VP

Have you tried unescaping the field :

 

 

<apex:outputtext value="..." escape="false"/>

 

 Warning : unescaped fields will also render javascript etc... I'd filter that out (google for 'OWASP')

 

jtranjtran

Hi David,

I tried adding the escape attribute as you have suggested and got further. Will see how far I can go with it.

Thanks,

 

James

 

Message Edited by jtran on 10-21-2009 10:56 AM