anybody got a parser class

CodeHighlighter for ASP.NET Forum

Posted 18 years ago by lx2222182@yahoo.com
Avatar
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]

Comments (2)

Posted 18 years ago by lx2222182@yahoo.com
Avatar
never mind. just finished mine. :) thanks
Posted 17 years ago by lx2222182@yahoo.com
Avatar
in case anybody is interested. I have the parser class here (not the greatest piece of code since I can't do regular expression, but it works)


You can see details and download information here. Source code is part of the application


[Modified at 12/29/2006 04:16 AM]

[Modified at 05/06/2007 12:56 AM]
The latest build of this product (v4.0.59) was released 13 years ago, which was after the last post in this thread.