项目地址: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

谢谢浏览!

Codekicker.BBCode(BBCode 和 HTML 互转的插件)介绍的更多相关文章

  1. Find命令、文件名后缀、Linux和Windows互传文件 使用介绍

    第2周第5次课(3月30日) 课程内容: 2.23/2.24/2.25 find命令2.26 文件名后缀 2.27 Linux和Windows互传文件 find命令 文件查找: 1.which(一般用 ...

  2. ModernUI教程:目录 (完结)

    入门 My first Modern UI app (manually)                         第一个ModernUI应用(手动编写)(已完成) My first Moder ...

  3. Django REST framework--序列化

    Django REST framework--序列化 基础准备工作 创建项目添加应用 (venv) lee@lee:~/PycharmProjects/Djdemo/djdemo$ python ma ...

  4. Django restful Framework 之序列化与反序列化

    1. 首先在已建好的工程目录下新建app命名为snippets,并将snippets app以及rest_framework app加到工程目录的 INSTALLED_APPS 中去,具体如下: IN ...

  5. javascript的一些知识

    一.Js的this,{},[] this是Javascript语言的一个关键字,随着函数使用场合的不同,this的值会发生变化.但是有一个总的原则,那就是this指的是调用的函数自己. { } 大括号 ...

  6. js最详细的基础,jquery 插件最全的教材

    一.Js的this,{},[] this是Javascript语言的一个关键字,随着函数使用场合的不同,this的值会发生变化.但是有一个总的原则,那就是this指的是调用的函数自己. { } 大括号 ...

  7. jQuery插件开发(转)

    jQuery插件开发全解析 jQuery插件的开发包括两种: 一种是类级别的插件开发,即给jQuery添加新的全局函数,相当于给jQuery类本身添加方法.jQuery的全局函数就是属于jQuery命 ...

  8. jQuery命名空间,插件开发

    jQuery插件的开发包括两种: 一种是类级别的插件开发,即给jQuery添加新的全局函数,相当于给jQuery类本身添加方法.jQuery的全局函数就是属于jQuery命名空间的函数,另一种是对象级 ...

  9. jQuery插件的开发之$.extend(),与$.fn.extend()

        jQuery插件的开发包括两种: 一种是类级别的插件开发,即给jQuery添加新的全局函数,相当于给jQuery类本身添加方法.jQuery的全局函数就是属于jQuery命名空间的函数,另一种 ...

随机推荐

  1. 使用码云,GitHub进行版本控制,并通过WebHook进行自动部署

    我们通常需要在 PUSH 代码到远程仓库时,线上环境会自动进行代码同步,这时候就需要用到WebHook,它会自动回调我们设定的http地址. 通过请求我们自已编写的脚本,来拉取代码,实现与远程仓库代码 ...

  2. Web前端基础(6):CSS(三)

    1. 定位 定位有三种:相对定位.绝对定位.固定定位 1.1 相对定位 现象和使用: 1.如果对当前元素仅仅设置了相对定位,那么与标准流的盒子什么区别. 2.设置相对定位之后,我们才可以使用四个方向的 ...

  3. Java生鲜电商平台-IntelliJ IDEA 最新注册码,亲测可用

    2019年IntelliJ IDEA 最新注册码(截止到2020年3月11日) 操作步骤: 第一步:  修改 hosts 文件 ~~~ 在hosts文件中,添加以下映射关系: 0.0.0.0 acco ...

  4. Spring Boot 之异步执行方法

    前言: 最近的时候遇到一个需求,就是当服务器接到请求并不需要任务执行完成才返回结果,可以立即返回结果,让任务异步的去执行.开始考虑是直接启一个新的线程去执行任务或者把任务提交到一个线程池去执行,这两种 ...

  5. 基于vue+uniapp直播项目|uni-app仿抖音/陌陌直播室

    一.项目简介 uni-liveShow是一个基于vue+uni-app技术开发的集小视频/IM聊天/直播等功能于一体的微直播项目.界面仿制抖音|火山小视频/陌陌直播,支持编译到多端(H5.小程序.Ap ...

  6. 《0day安全软件漏洞分析技术》学习笔记

    最近因为工作需要在看0day的软件漏洞分析,发现这本<0day安全软件漏洞分析技术(第2版)>真是本好书,唯一缺点就是书上的环境是Windows XP 32Bit的,基于现状难以进行实践, ...

  7. 学习springboot第一天~

    1. springboot是对spring的缺点进行改善和优化,它的约定大于配置,开箱即用,没有代码生成,也不需要xml文件配置,可以修改属性值来满足需求 2. springboot的入门程序 在id ...

  8. linux SSH设置

    环境:centos7 一. ssh连接超时设置 (1)客户端设置(推荐) 客户端是windows系统 连接工具:SecureCRT 1.SecureCRT客户端->Options(选项)-> ...

  9. (六)Amazon Lightsail 部署LAMP应用程序之升级到Amazon EC2

    升级到Amazon EC2 将Amazon Lightsail实例升级为Amazon EC2 您将进行以下操作: ①创建使用 Amazon RDS的Web前端实例的快照 ②将该快照导出到 Amazon ...

  10. OpenTelemetry项目中的Observability

    最近,在实操zipkin,jaeger,opencensus,opentracing,opentelemetry等. opentelemetry将Observability提到了重要页面, 并进行了讲 ...