| Platform: | Coldfusion |
| Task: | A Better ParagraphFormat function |
| Discussion: | The Coldfusion ParagraphFormat function sucks. Try this one. |
| Example: | <!--- custom functions --->
<cfscript>
//this is similar to ParagraphFormat except it actually formats it correctly and xhtml valid
//takse a database text field and restores all the paragraph breaks.
function XHTMLParagraphFormat(string){
returnValue = Replace(string,"&","&","ALL");
returnValue = Replace(returnValue,"#Chr(13)#","<br />","ALL");
return returnValue;
}
</cfscript> |