Codekicker.BBCode(BBCode 和 HTML 互转的插件)介绍
项目地址:http://bbcode.codeplex.com/
项目介绍:
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 互转的插件)介绍的更多相关文章
- Find命令、文件名后缀、Linux和Windows互传文件 使用介绍
第2周第5次课(3月30日) 课程内容: 2.23/2.24/2.25 find命令2.26 文件名后缀 2.27 Linux和Windows互传文件 find命令 文件查找: 1.which(一般用 ...
- ModernUI教程:目录 (完结)
入门 My first Modern UI app (manually) 第一个ModernUI应用(手动编写)(已完成) My first Moder ...
- Django REST framework--序列化
Django REST framework--序列化 基础准备工作 创建项目添加应用 (venv) lee@lee:~/PycharmProjects/Djdemo/djdemo$ python ma ...
- Django restful Framework 之序列化与反序列化
1. 首先在已建好的工程目录下新建app命名为snippets,并将snippets app以及rest_framework app加到工程目录的 INSTALLED_APPS 中去,具体如下: IN ...
- javascript的一些知识
一.Js的this,{},[] this是Javascript语言的一个关键字,随着函数使用场合的不同,this的值会发生变化.但是有一个总的原则,那就是this指的是调用的函数自己. { } 大括号 ...
- js最详细的基础,jquery 插件最全的教材
一.Js的this,{},[] this是Javascript语言的一个关键字,随着函数使用场合的不同,this的值会发生变化.但是有一个总的原则,那就是this指的是调用的函数自己. { } 大括号 ...
- jQuery插件开发(转)
jQuery插件开发全解析 jQuery插件的开发包括两种: 一种是类级别的插件开发,即给jQuery添加新的全局函数,相当于给jQuery类本身添加方法.jQuery的全局函数就是属于jQuery命 ...
- jQuery命名空间,插件开发
jQuery插件的开发包括两种: 一种是类级别的插件开发,即给jQuery添加新的全局函数,相当于给jQuery类本身添加方法.jQuery的全局函数就是属于jQuery命名空间的函数,另一种是对象级 ...
- jQuery插件的开发之$.extend(),与$.fn.extend()
jQuery插件的开发包括两种: 一种是类级别的插件开发,即给jQuery添加新的全局函数,相当于给jQuery类本身添加方法.jQuery的全局函数就是属于jQuery命名空间的函数,另一种 ...
随机推荐
- WPF 解决多个TreeViewItem同时触发某事件的简单方法
原理是: 因为是双击事件,也就是同时引发了选择事件,TreeViewItem的IsSelected为True.通过触发器设置某个属性为特殊值,然后在CS页面的双击事件方法内判断是否此值即可. xaml ...
- Idea-搜索快捷键
1.Ctrl+N按名字搜索类 相当于eclipse的ctrl+shift+R,输入类名可以定位到这个类文件,就像idea在其它的搜索部分的表现一样,搜索类名也能对你所要搜索的内容多个部分进行匹配,而且 ...
- wpf datetime format
<Style TargetType="{x:Type DatePickerTextBox}"> <Setter Property="Control.Te ...
- 帝国cms提高网站网页打开速度的手段
1.减少页面HTTP请求数量 2.使用CDN(Content Delivery Network)网络加速 3.添加文件过期或缓存头 4.服务器开启gzip压缩 5.css格式定义放置在文件头部 6.J ...
- GO与PHP的AES交互,key长度问题
今天在使用go与php的AES加解密交互中,一直有个问题那就是在go中加密后,在php端始终都是无法解密,经过排查最后发现是加密key长度引起的问题, 这里简单记录下. go的AES使用的是第三方的库 ...
- MySQL入门——在Linux下安装和卸载MySQL
MySQL入门——在Linux下安装和卸载MySQL 摘要:本文主要学习了如何在Linux系统中安装和卸载MySQL数据库. 查看有没有安装过MySQL 使用命令查看有没有安装过: [root@loc ...
- 协议分析中的TCP/IP网络协议
- 链路层 第一层包含源mac及目的mac,随着传输路径的变化会发生变化,在mac之后,是下层网络协议的类型,图中,下层为IP协议. 在协议解析中,需要关注的是图中type这个字段的内容. - 网络层 ...
- Mixins and Python
什么是Mixin (混入) Mixin 这个词在Python/Ruby中经常使用, Java 中几乎看不到这个名词. 在Java 中, 我们经常定一个一个子类扩展了某个基类, 同时实现某些接口. 因为 ...
- springboot + shiro + mysql + mybatis 工程快速搭建
1. 新建 springboot 工程 2. 随便起个名字 3. 初始化工程 4. 导入 shiro 和 thymeleaf 依赖 <!-- thymeleaf依赖 --> <dep ...
- Node.js—学习
一.Node.js 1. Hello World var http = require('http'); http.createServer(function(request, response) { ...