I don't know if it'll help in your situation, but I've done a BBML
parser in CF that might solve some of your problems:

http://www.depressedpress.com/DepressedPress/Content/ColdFusion/CustomTa
gs/DP_ParseBBML/Index.cfm

The basic idea is that users are allowed a simplified version of HTML,
BBML (actually an HTML-like mark up).  With it they can do most
formatting (bold, lists, links, images), but nothing else (script,
tables, etc).

In effect it lets you offer some presentation control without risk the
general layout of the site.

Jim Davis


> -----Original Message-----
> From: Russ [mailto:[EMAIL PROTECTED]] 
> Sent: Wednesday, February 05, 2003 7:41 PM
> To: CF-Talk
> Subject: ReReplace for HTML tags
> 
> 
> All...
> 
> I'm attempting to combine a few options--and I'm realizing 
> that it's not working out as well as I'd hoped, but for 
> obvious reasons.
> 
> Hopefully, someone will know what I'm attempting to do and 
> guide me to the light a little bit.
> 
> Users make comments to a blog--when they make those comments, 
> they are entered into the database.  When we view the 
> comments, we have set some variables so the carriage returns 
> are placed accordingly, by doing:
> 
> <CFSET strCRLF = #Chr(10)# & #Chr(13)#>
> <CFSET strHTMLCRLF = "<P/>">
> 
> When we apply those variables to the comment of the blog: 
> #Replace(blogContent,strCRLF,strHTMLCRLF,'all')#
> 
> Everything works nicely from a display perspective.  In order 
> to be safe, secure and prevent anyone from entering junk into 
> our comments--such as unclosed HTML tags or other junk that 
> could "break" the site, I have set the following:
> 
> <CFSET commentOutput = 
> "#Replace(commentPost,strCRLF,strHTMLCRLF,'all')#">
> 
> THEN, because I thought I was wise, I did the following:
> 
> #ReReplace(commentOutput,"<[^>]*>"," ","all")# 
> 
> This is an attempt to strip out any HTML that anyone ELSE 
> might but in, failing to realize that I'd just stripped out 
> my own HTML that I wanted to place in there.  I am taking a 
> guess that I'd have to get rid of the "all" in my ReReplace, 
> but I'm not entirely sure how that'd work nor am I sure 
> that's the right path.
> 
> Can anyone offer any insight?
> 
> Thanks!
> 
> Russ Unger
> Managing Partner
> blueChrome design, LLC
> www.bluechromedesign.com
> 312.593.4260 :office
> 877.433.8427 :pager
> 312.873.4033 :fax
> 
> Yep, we're hosting CFMX and MySQL.  Email for info.
>  
> 
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

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

Reply via email to