Skip to main content
GameDev.net gamedev.net

PRO Tired of ads? Read GameDev.net ad-free and help keep the community independent with GameDev Pro — $3/month.

BBCode

BBCode

Aardvajk
Aardvajk
Journal of Aardvajk · · 2 min read
460 1
Bleh. No energy to post really but here goes.

Got back into working on my website. I've finally given in and bought some hosting that provides one MS SQL 2008 database as part of the package. Total cost is about GBP7.50 a month but I'm still locked into previous GBP5 package with the dreaded Fasthosts. Still, it's only a few quid a week I suppose.

Domain hasn't propagated over yet but I've got some work done on my site offline with VS Web Express.

Lunchtime today and tonight I've written a BBCode to HTML parser in C# ready to be dropped into the App_Code directory. It works pretty well - you specify tags into a static dictionary like this:

Tags.Dictionary.Add("url","{value}",true);


It's inspired by someone else's .NET BBCode library interface but I can't find the link. I've not used anyone else's code, just his syntax for populating the dictionary.

I figure I'll maybe use a Session variable to detect if the dictionary has been populated before calling the conversion function.

It is quite robust in that if at any point while trying to figure out BBTags it gets lost, it returns to the start and outputs the text unconverted. It also deals with syntax errors in the dictionary format strings in the same way.

Chickened out a bit on newlines - one newline produces a br and two or more produce a single paragraph.

Haven't really tested it yet (just been looking at the HTML output in a console window) but seems to work okay. Should certainly be sufficient for comments on journal posts. Whether it will scale up to forum postings I don't know but I'm quite interested in writing the forum code myself rather than use an existing library as an exercise in web programming.

I'm really enjoying web programming. It seems ironic that the potential to actually earn a living at this is far greater than in C++ development or games programming, considering how much more straightforward it seems to be.

PS: @benryves I'm now using CSNewMedia as per your previous comment and they seem really good so thanks for that. CS himself was manning the support ticket system night before last at about 11:30pm and was really helpful.

Discussion

Loading comments...