While newlines are generally ignored by html, in reality they are put in using 
things like break tags, empty paragraph tags and css (and probably more that I 
haven't seen. Because of the way the html is created from the original raw 
text, the new lines will  be represented by some sort of html tag. The second 
line, which removes all of the tags, does not remove any newlines when it does. 
This leaves the newlines in to be 'reduced'.
If the HTML was standardized with each new line being represented by a break 
then your way would probably work. As is....

Open up an email from someone (other than a list message which is plain text) 
and look at the html generated. ugly stuff.

>Since newlines are supposedly ignored by HTML, I'd maybe do this:
>
>1) replace <br( /)?> tags with something unusual, like the bell chr(7).
>2) remove HTML
>3) remove *all* newlines.  Maybe with several replace() calls instead of 
>rereplace() -- efficiency tests may be required.
>4) replace the bell with newlines
>
>I'm not sure if that's *better*, but that's what I'd do.
>
>--Ben "Ninja" Doom
>
>Michael Dinowitz wrote: 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Check out the new features and enhancements in the
latest product release - download the "What's New PDF" now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: http://www.houseoffusion.com/groups/RegEx/message.cfm/messageid:1050
Subscription: http://www.houseoffusion.com/groups/RegEx/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.21

Reply via email to