Rick,

Looks good. Nice idea for a UDF by the way. The only concern I have is
the .* for selecting the "rest" of a tag. I don't know off hand, but I
think that by default "." does NOT match on line breaks (I could be way
off here though). This will not allow for tags that wrap lines. You
might want to try [^>]* instead. But, this will break if the ">" appears
in one of the tag attribute values. 

Also, I think it will break with nested comments (the non-greed search
would find: <!-- bla bhal bha <!-- more blah -->  which will leave the
rest of the comment in place (I think). This is a huge issue with
patters. Just like handling nested quote attributes. I have not got a
good handle on how to solve this problem in the least. 

Just my two cents. But, really, that's a cool method. 


......................
Ben Nadel
Certified Advanced ColdFusion MX7 Developer
www.bennadel.com
 
Need ColdFusion Help?
www.bennadel.com/ask-ben/

-----Original Message-----
From: Rick Root [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 28, 2006 3:54 PM
To: CF-Talk
Subject: UDF inspection, please!

I just finished rewriting my ancient tagstripper custom tag into a UDF.

It will strip HTML tags, optionally preserving a list of specified tags,
or simply strip only a list of specified tags.

ie, #tagStripper(myString,"preserve","link,script,embed,object")# would
remove the specified tags but preserve all other tags, while
#tagStripper(myString,"strip","b,i,a")# would strip all tags EXCEPT the
specified tags.

Please take a look at my code and let me know if you see any potential
issues with it.

http://www.opensourcecf.com/1/2006/11/Using-coldfusion-to-strip-some-or-
all-HTML-tags-from-a-string.cfm
or
http://tinyurl.com/ym3jsv

Thanks.

Rick Root



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261921
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