BBCode / HTML过滤器 [英] BBCode/HTML filters

查看:62
本文介绍了BBCode / HTML过滤器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

另一个线程引起了人们的兴趣:

使用BBCode,您是否必须安装该软件包,还是识别它的浏览器?我想让自己的网站让某些用户编辑代码(不需要知道HTML),所以我只是想知道我应该在哪里看。大多数链接都是指phpBB论坛,但这将在我的网站上使用我自己的代码。


或者,如果这不可用,你们中的任何人都知道一个好的免费html过滤器(基本上是我认为的BBCode)?

解决方案


另一个线程引起了兴趣:

使用BBCode,您是否必须安装该软件包,还是识别它的浏览器?我想让自己的网站让某些用户编辑代码(不需要知道HTML),所以我只是想知道我应该在哪里看。大多数链接都是指phpBB论坛,但这将在我的网站上使用我自己的代码。


或者,如果这不可用,你们中的任何人都知道一个好的免费html过滤器(基本上我认为BBCode是什么)?



您可以安装它,也可以创建自己的。它与浏览器无关。


您只需将[b] text [/ b]转换为< b>文字< / b>使用正则表达式。


:)


实现基本的 BBCode 标记自己,就像Marcus提到的那样。


你可以简单地使用 str_replace 用它们的HTML副本替换BBCode标签。


例如,对于粗体和斜体文本:

展开 | 选择 | Wrap | 行号



实现基本的 BBCode非常简单标记自己,就像马库斯提到的那样。



Markus带着k,我的朋友。


;]


Another thread sparked an interest:
With using BBCode, do you have to install that package or is it the browser that recognises it? I would like to make my own for my website to let certain users edit the code (without needing to know html) and so I was just wondering where I should look. Most of the links refer to phpBB forums, but this will be using my own code on my site.

Alternatively, if this is not available, do any of you know a good free html filter (which is basically what BBCode is I believe)?

解决方案

Another thread sparked an interest:
With using BBCode, do you have to install that package or is it the browser that recognises it? I would like to make my own for my website to let certain users edit the code (without needing to know html) and so I was just wondering where I should look. Most of the links refer to phpBB forums, but this will be using my own code on my site.

Alternatively, if this is not available, do any of you know a good free html filter (which is basically what BBCode is I believe)?

You can install it, or create your own. It''s nothing to do with the browser.

You just turn [b] text [/b] into <b> text </b> using regular expressions.

:)


It is very simple to implement the basic BBCode tags yourself, like Marcus mentioned.

You could simply use str_replace to replace the BBCode tags with their HTML counterparts.

For example, for bold and italic text:

Expand|Select|Wrap|Line Numbers


It is very simple to implement the basic BBCode tags yourself, like Marcus mentioned.

Markus with a k, my friend.

;]


这篇关于BBCode / HTML过滤器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆