We're having issues with the wraptext attribute in CFMAILPARAM on 6.1

It's ignoring return characters when calculating line lengths and inserting a 
line break after every 72 characters regardless of whether there has been a 
line break before then.

The Wrap() function seems to do the same.

There's some code below that'll demonstrate the problem.

Any know a solution or have a good Wrap() function they've written themselves?

Tom

<!--- can test with different line endings --->
<cfset cr = chr(13) & chr(10)>

<!--- Some sample text --->
<cfset lorem="Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed 
diam nonummy nibh 
euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim 
ad minim veniam, 
quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea 
commodo consequat.
 Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie 
consequat, 
 vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto 
odio 
 dignissim qui blandit praesent luptatum zzril delenit augue duis 
 dolore te feugait nulla facilisi.">

<!--- generate a single line from the string above --->
<cfset lorem=REReplace(lorem,"[\r\n]"," ","all")>

<!--- generate paragraphs --->
<cfset txt ="">
<cfloop index="i" from="1" to="30">
        <cfset txt = txt & Left(lorem,randrange(1,Len(Lorem))) & cr & cr>
</cfloop>

<!--- wrap at 72 --->
<cfset tmp = Wrap(txt,72)>

<!--- first lines of para wrapped incorrectly --->
<pre>
<cfoutput>#tmp#</cfoutput>
</pre>

Tom Peer


Address: Lemon Studios, 85 Clerkenwell Road, London EC1R 5AR

Sales/support:  0845 272 3329 (UK)/ + 44 (0) 20 7681 4032       
Mobile:  07968 123329   
Email:   [EMAIL PROTECTED]      
Web:     www.digitalmethod.co.uk        

Tel:    0845 272 3329 (UK Only)
        +44 20 7681 4032 outside the UK.
Mobile: 07968 123 329
Mail:   [EMAIL PROTECTED]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 & 
Flex 2. 
Free Trial 
http://www.adobe.com/products/coldfusion/flex2/

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:270482
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to