项目地址:http://bbcode.codeplex.com/

项目介绍:

Codekicker.BBCode is a stable and performant BBCode-Parser for .NET. 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. Codekicker.BBCode is used in-the-field on http://codekicker.de which is a german question and answer site for programming questions.

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=http://codekicker.de]codekicker[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.

Quickstart
Just call

BBCode.ToHtml("[url=http://codekicker.de]codekicker[url]")

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 Pex (http://research.microsoft.com/en-us/projects/Pex/) to extensively test some important properties of this BBCode-Parser. We used Pex 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//codekicker.de if you speak german. In other cases you can contact us by email in english.

Licence
This BBCode-parser is licensed unter the Creative Commons Attribution 3.0 Licence:http://creativecommons.org/licenses/by/3.0/. 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 seem to be very buggy and immature. Now we don't have trouble anymore.

What else?
That's it. It is that easy to use. If you have questions, feature suggestion or bug reports (very unlikely) you can contact us at team@codekicker.de in english and german. If you do speak german you should instead post you question on http//codekicker.de.

 

Last edited Oct 6, 2011 at 3:27 PM by codekicker, version 16

谢谢浏览!

最新文章

  1. nagios的nrpe的check_command配置优化
  2. 当 NSDictionary 遇见 nil
  3. 在项目里交叉使用Swift和OC【转】
  4. jQuery学习小结1-CSS操作+事件
  5. zoj 2588 Burning Bridges
  6. html 设置Select options值进行绑定
  7. 图解SVD分解
  8. 使用tomcat的jndi方式连接mysql的字符编码设置
  9. log4j学习日记-写入数据库
  10. Combination Sum,Combination Sum II,Combination Sum III
  11. IOS 学习笔记(3) 视图UITabbarController
  12. JAVA课程设计猜数游戏 个人
  13. Basic Data Structure
  14. 自动创建字符设备,不需mknod
  15. Linux性能分析工具top命令详解
  16. Best Time to Buy and Sell Stock i
  17. promise-笔记
  18. Mysql 储存引擎
  19. Python模块搜索路径
  20. [转]Eclipse下导入外部jar包的3种方式

热门文章

  1. pandas 学习 第3篇:Series - 数据处理(应用、分组、滚动、扩展、指数加权移动平均)
  2. Z从壹开始前后端分离【 .NET Core2.2/3.0 +Vue2.0 】框架之五 || Swagger的使用 3.3 JWT权限验证【必看】
  3. Django---SETTINGS配置(***)
  4. JS是解释型还是编译型语言?
  5. 比较好用的移动端适配的两种方案及flexible和px2rem-loader在webpack下的配置
  6. Python工具库分享
  7. Android开发总体布局
  8. 一文解读ITIL (转)
  9. 浅谈P/NP问题
  10. optimizer.zero_grad()