paragraphFormat

Replaces characters in a string:
* Single newline characters (CR/LF sequences) with spaces
* Double newline characters with HTML paragraph tags (<p>)

paragraphFormat(String) → returns string

Argument Reference

String string
Required

Examples
Sample code invoking the paragraphFormat function

A single line break becomes a space, a double line break starts a new paragraph.

text = "This sentence" & chr(10) & "continues here." & chr(10) & chr(10) & "This is a new paragraph.";
writeOutput( paragraphFormat( text ) );

Expected Result: This sentence continues here. <P> This is a new paragraph. <P>

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub