Codekicker.BBCode is a stable and fast BBCode-Parser for .NET. It can transform any BBCode into HTML or into an in-memory syntax tree that can be analyzed or translated. All tags are fully customizable, nothing is hardcoded.

The design goals of Codekicker.BBCode were:
  • Stable - it never ever crashes
  • Safe - it does not let through unsafe HTML like <script> under any circumstances
  • Performance - it is meant to be used in production
  • Easy to use - Just call BBCode.ToHtml("[url=][url]")
  • Customizable - Customizing the translation of every tag is easy and flexible
  • Error messages - the messages are available in English and German. Language contributions are welcome.

Just call BBCode.ToHtml("My [b]BBCode[/b] [i]here[/i]")

How do I customize the markup set?
            var parser = new BBCodeParser(new[]
                    new BBTag("b", "<b>", "</b>"), 
                    new BBTag("i", "<span style=\"font-style:italic;\">", "</span>"), 
                    new BBTag("u", "<span style=\"text-decoration:underline;\">", "</span>"), 
                    new BBTag("code", "<pre class=\"prettyprint\">", "</pre>"), 
                    new BBTag("img", "<img src=\"${content}\" />", "", false, true), 
                    new BBTag("quote", "<blockquote>", "</blockquote>"), 
                    new BBTag("list", "<ul>", "</ul>"), 
                    new BBTag("*", "<li>", "</li>", true, false), 
                    new BBTag("url", "<a href=\"${href}\">", "</a>", new BBAttribute("href", ""), new BBAttribute("href", "href")), 
            return parser.Transform("[b]bbcode[/b]");

Why is it as stable as we claim?
We have used Visual Studio IntelliTest (Announcement for Visual Studio 2015: to extensively test some important properties of this BBCode-Parser. We used IntelliTest to ensure that the parser never crashes and that it never emits any dangerous tag such as <script>, no matter what the input was. The user can type any HTML he wants but it will just get encoded, even when it is in unusual places like the href-attribute of the url-tag. If you have any questions about this you can post them on http// if you speak German. In other cases you can contact us by email in English.

This BBCode-parser is licensed under the Creative Commons Attribution 3.0 Licence: You can freely use and modify the code even commercially. Please help us spread the word: We require a link from anywhere on your corporate website or blog (or from a staff-member's personal blog).

Who can use it?
As this parser is written in C#, it can be used in any .NET-Language like C# or VB.NET. The reason why we wrote it is that all existing BBCode-parsers for .NET were fundamentally broken and immature.

What else?
If you have questions, feature suggestion or bug reports you can contact us at in English or German. If you do speak German you should post your question on http//

Last edited Jun 19 at 4:55 PM by codekicker, version 17