Skip to content

Miscellaneous

simpleFormat()

simpleFormat() — returns any

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

NameTypeRequiredDefaultDescription
textstringyesThe text to format.
wrapbooleanyestrueSet to true to wrap the result in a paragraph.
<!--- How most of your calls will look --->
#simpleFormat(post.bodyText)#

<!--- 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>