The ParagraphFormat() function is pretty weak, since it doesn't generally
put the <p> tags in the appropriate places (i.e. at the beginning of
paragraphs...)
I suggest the following solution using regular expressions:
<cfset YourText = #REReplace( YourText,
"([#chr(10)##chr(13)#][#chr(10)##chr(13)#]?)","<br> ","ALL")#>
Although, to kill the header/trailing carriage-returns/spaces I would
suggest trimming it like so:
<cfset YourText = #REReplace( Trim(YourText),
"([#chr(10)##chr(13)#][#chr(10)##chr(13)#]?)","<br> ","ALL")#>
At 06:29 PM 1/3/2001 -0600, you wrote:
>But doesn't that one pick up blank lines and insert <p> tags where it finds
>blank lines? This example doesn't have a blank line between the text, only
>a single carriage return.
>
>At 06:04 PM 1/3/01 -0600, you wrote:
> >use the ParagraphFormat() function on the outputted text.
> >
> >Bernd VanSkiver
> >[EMAIL PROTECTED]
> >ICQ #: 916324
> >
> >
> >-----Original Message-----
> >From: S R [mailto:[EMAIL PROTECTED]]
> >Sent: Wednesday, January 03, 2001 6:00 PM
> >To: CF-Talk
> >Subject: format question
> >
> >
> >I have a page in which I need to display a block of text, pulled from a
> >database, with the 'returns' doing exactly what the user intended.
> >
> >For example I need it to look like this:
> >
> >This is one line.
> >Here is another.
> >And one more
> >
> >Instead of this:
> >
> >This is one line. Here is another. And one more.
> >
> >Note: This is not a textarea or form field of any sort, I already know how
> >to do that with HTMLEditFormat, but that does not seem to work for this
> >
> >Thanks
> >
> >Sal
> >
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists