A reader asks:
I want to create a discussion board where I can retain the carriage returns that my users have entered - how can I pull their entries from the Database and retain the carriage returns without using the <pre> tags?
Out of the box, ColdFusion provides us with a paragraphFormat() function. This will correctly format blocks of text in paragraphs, inserting a P tag at blank lines. However, it won’t correctly notice simple line breaks, like in an address. You can get around this by using a user-defined function like paragraphFormat2, written by Ben Forta. This UDF simply looks out for line breaks and inserts a BR tag. I use this on my Galleon ColdFusion forums.