Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

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.

share|improve this question
    
Any reason why you go with output text .Go with outputfield instead –  Mohith Shrivastava Aug 6 at 18:21

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer
    
Like I thought, some mundane detail I missed. Thank you very much. –  Programmable Medley Aug 6 at 18:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.