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
Michael MMichael M 

Remove tags from rich text area being displayed on VF page

Hello, I am displaying a rich text area (specifically, the body of chatter notes) on a VF page. The issue is that the html tags are showing on the page, e.g. if the note says "hello", my page shows: "<p> hello</p>". How can I get rid of those tags?

Here are the relevent snippets from the PAGE:

  <apex:pageBlockTable value="{!listofNotes}" var="noteslist">
   <apex:column >
       <apex:facet name="header">Note</apex:facet>
    <apex:outputText value="{!noteslist.Body}"/>
   </apex:column>

and from the Controller:
listofNotes = [SELECT ID, CreatedDate, CreatedById, CreatedBy.FirstName, CreatedBy.LastName, ParentId, Parent.Name, Body
                      FROM feeditem 
                      WHERE  Parentid IN (Select id from Discharge__c where Name =: discharge.name AND Date_of_Birth__c =: discharge.date_of_birth__c)];
Best Answer chosen by Michael M
VinayVinay (Salesforce Developers) 
Hi Michael,

Try to use escape ="false" attribute with in <apex:outputtext> .

<apex:outputText escape="false" value="{!noteslist.Body}"/>

Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,
Vinay Kumar

All Answers

VinayVinay (Salesforce Developers) 
Hi Michael,

Try to use escape ="false" attribute with in <apex:outputtext> .

<apex:outputText escape="false" value="{!noteslist.Body}"/>

Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,
Vinay Kumar
This was selected as the best answer
Michael MMichael M
That did it. Thank you very much
System Admin19System Admin19
thank you!