3

I am trying to render some HTML stored within a custom sObject's a richText field.

I am using an outputText field as follows:

<apex:outputText value="{!Information.Content__c}" escape="false"/>

The field contains the following:

<code> CoolCodeExample codeExample = new CoolCodeExample(); </code>

However, it is not being rendered as HTML.

When I inspected it in the browser, the <code> tag is being wrapped with double quotes.

Anyway I can have this properly rendered in HTML? I imagine it is something mundane I've overlooked. Any help is most appreciated.

1
  • Any reason why you go with output text .Go with outputfield instead Commented Aug 6, 2014 at 18:21

1 Answer 1

7

Per doc: https://help.salesforce.com/HTViewHelpDoc?id=fields_using_rich_text_area.htm&language=en_US

HTML code is not supported in the Salesforce HTML editor. HTML code is treated as text.

Using a Long Text Area field with

<apex:outputText value="{!Information.LongTextField__c}" escape="false"/> works.

1
  • Like I thought, some mundane detail I missed. Thank you very much. Commented Aug 6, 2014 at 18:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .