You are viewing documentation for v1.1.x. Change

simpleFormat()

Description

Replaces single newline characters with HTML break tags and double newline characters with HTML paragraph tags (properly closed to comply with XHTML standards).

Function Syntax

simpleFormat(text [, wrap ])

Parameters

Parameter Type Required Default Description
text string Yes The text to format.
wrap boolean No true Set to true to wrap the result in a paragraph.

Examples

<!--- How most of your calls will look --->
#simpleFormat(post.comments)#

<!--- Demonstrates what output looks like with specific data --->
<cfsavecontent variable="comment">
    I love this post!

    Here's why:
    * Short
    * Succinct
    * Awesome
</cfsavecontent>
#simpleFormat(comment)#
->
<p>I love this post!</p>
<p>
Here's why:<br />
     * Short<br />
     * Succinct<br />
     * Awesome
</p>