Was not! OK, maybe. Actually what I was going to suggest was replacing
the <> on the html tags you want with a control character like chr(27)
then stripping all the tags, then swapping the escaped tags back in.
This was pre-first cup of morning coffee however. Isaac's udf looks
nice. 

> -----Original Message-----
> From: S. Isaac Dealey [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, 25 February 2003 9:43 a.m.
> To: CF-Talk
> Subject: Re: Allowing specific HTML tags to be displayed
> 
> 
> Hey Russ -- I already know what Matt's going to recommend ant 
> that's using
> <cfimport> with an empty prefix value which will allow you to 
> specify a
> directory of CF modules to replace the html tags. It's not a 
> bad solution,
> however, the problem you're going to have is that you need 1 
> tag for each
> html element someone might type into the form, so ... to 
> avoid that kind of
> work-creep, you might want to check out the StripTags() 
> function that can be
> found both in the open-source API in my sig and on www.cflib.org.
> 
> <cfset thedata = striptags("allow","a,b,i,img",thedata)>
> 
> This syntax will remove any xml-style tag that's not a link 
> (or anchor),
> bold, italic or html image tag from the string. Note that it doesn't
> currently remove anything but the tags themselves, so given the string
> "hello <blink>world</blink>" it would return "hello world", 
> not "hello ".
> 
> You'll probably want to do this _before_ the data goes into the db if
> possible because it's a reasonably large function with a lot of string
> manipulation.
> 
> hth
> 
> s. isaac dealey                954-776-0046
> 
> new epoch                      http://www.turnkey.to
> 
> lead architect, tapestry cms   http://products.turnkey.to
> 
> tapestry api is opensource     http://www.turnkey.to/tapi
> 
> certified advanced coldfusion 5 developer
> http://www.macromedia.com/v1/handlers/index.cfm?ID=21816
> 
> 
> > Are you running CF5 or CFMX?
> 
> > ----- Original Message -----
> > From: "Russ" <[EMAIL PROTECTED]>
> > To: "CF-Talk" <[EMAIL PROTECTED]>
> > Sent: Tuesday, February 25, 2003 8:16 AM
> > Subject: Allowing specific HTML tags to be displayed
> 
> 
> >> All--
> >>
> >> I've still not had any luck trying to get Replace or
> >> ReReplace to allow
> >> a set of specific codes when displaying information from
> >> a database.
> >>
> >> I'm hoping to allow for only specific sets:  Italics,
> >> Bold, A HREF and
> >> IMG SRC and I'm baffled as to how to get this to work.
> >> It's a bit of a
> >> repost, but I'm really striking out.
> >>
> >> Thanks,
> >>
> >> Russ
> >>
> >>
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > ~~~~~~~~~~~|
> > Archives:
> > http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
> > Subscription: http://www.houseoffusion.com/cf_lists/index.
> > cfm?method=subscribe&forumid=4
> > FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
> > This list and all House of Fusion resources hosted by
> > CFHosting.com. The place for dependable ColdFusion
> > Hosting.
> 
> >                             Unsubscribe: 
> http://www.houseoffusion.com/cf_lists/uns
> >                             ubscribe.cfm?user=633.558.4
> 
> 
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to