Posted 18 years ago
by lx2222182@yahoo.com

Hi saw a previouse code on BBcode, and I'm wondering if anybody already have code to parse them, so I can dynamically insert codehiglither on the server side in my forum applicaiton.
for example, my users would post some comments in a forum just like here. and I want to give them some options do something like
user comments line1
user comments line2
[code language="C#"]
user c# code
[/code]
the rest of user comments.
and after the user posted their comment, my server side parser class would post their comments as usual, but if i detected the [code language="C#"][/code] tag, the parser would place a dynamically codelighter control into the mids of the code and continue with the rest of the comments.
I would imagine the parser class returns an array of objcts, soemthing like
obj1.comment = "user comments line1
user comments line2"
obj1.commenttype = "regular"
// this is when I know I need to contract a codehilighter.
obj2.comment = "user c#code";
obj2.commenttype= "C#"
etc
I'm trying to write a parser class for this puprose, but I just want to see if anybody already have one, so I can save sometime.
[Modified at 12/29/2006 03:36 AM]
for example, my users would post some comments in a forum just like here. and I want to give them some options do something like
user comments line1
user comments line2
[code language="C#"]
user c# code
[/code]
the rest of user comments.
and after the user posted their comment, my server side parser class would post their comments as usual, but if i detected the [code language="C#"][/code] tag, the parser would place a dynamically codelighter control into the mids of the code and continue with the rest of the comments.
I would imagine the parser class returns an array of objcts, soemthing like
obj1.comment = "user comments line1
user comments line2"
obj1.commenttype = "regular"
// this is when I know I need to contract a codehilighter.
obj2.comment = "user c#code";
obj2.commenttype= "C#"
etc
I'm trying to write a parser class for this puprose, but I just want to see if anybody already have one, so I can save sometime.
[Modified at 12/29/2006 03:36 AM]