[SalesForce] How to Replace “
” in a sObjects field with an actual line breaks on VisualForce

I have a sObject that has a field called text__c.

I wish to display it on the visual force page.

The text will have line breaks in it.

Is there anyway for me to display this on a VisualForce page to include the line breaks, or must I break it up into multiple entries?

I was hoping that there would be a way to replace any set of characters, whether it is a /n or <br /> from the field with an actual <br/> html tag.

Thank you.

Best Answer

You can use apex:outputText with the escape attribute explicitly set to "false". Note however that this opens you up to security risks with injected content, such as JavaScript and other HTML tags.