Simple BBparser in PHP that lets you replace content outside tags

最后都变了- 提交于 2019-12-02 10:59:54
Charles

Do you guys know a BB parser class written in PHP that I can use for this, instead of regexes?

There's the BBCode PECL extension, but you'd need to compile it.

There's also PEAR's HTML_BBCodeParser, though I can't vouch for how effective it is.

There are also a few elsewhere, but I think they're all pretty rigid.

I don't believe that either of those do what you're looking for, with regard to having a callback for tag contents (and then @webarto is totally correct in that HTMLPurifier is the right tool to use when processing the contents). You might have to write your own here. I've previously written about my experiences doing the same that you might find helpful.

HTML Purifier http://htmlpurifier.org/

But you are facing same issues just like in your 20 previous questions.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!