<cfscript>
function Textarea2paragraphs(str) {
        str = Trim(str);
        str = ReReplace("<p>" & str & "</p>", "(\r+)?\n(\r+)?\n", "</p><p>", 
"ALL");
        str = ReReplace(str, chr(13) , "<br>", "ALL"); 
        str = ReReplace(str, chr(10) , "", "ALL");
        str = ReReplace(str, "</p><p>", "</p>" & chr(13) & "<p>", "ALL");
        return str;     
        }
</cfscript>

http://www.pixel69.com/paragraph_test.cfm

Tested on windows only. Hope somebody finds it useful.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:348532
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to