youthweb / bbcode-parser
BBCode-to-HTML 解析器
1.7.1
2021-11-24 10:55 UTC
Requires
- php: ^7.4 || ^8.0
- cache/void-adapter: ^1.1
- jakeasmith/http_build_url: ^1
- jbbcode/jbbcode: ^1.4
- youthweb/urllinker: ^1.4
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.3
- phpstan/phpstan: ^1.2
- phpunit/phpunit: ^9
README
youthweb.net 的 BBCode-to-HTML 解析器
安装
通过 Composer
$ composer require youthweb/bbcode-parser
使用方法
use Youthweb\BBCodeParser\Manager; $text = '[h1]Hello World![/h1] This is a [i]simple[/i] test to demonstrate the [b]BBCodeParser[/b].'; $parser = new Manager(); $config = ['parse_headlines' => true]; echo $parser->parse($text, $config); // "<h1>Hello World!</h1> // <p>This is a <i>simple</i> test to demonstrate the <b>BBCodeParser</b>.</p>"
更新日志
请参阅 更新日志 了解最近更改的详细信息。
测试
$ vendor/bin/phpunit
贡献
请随意提交错误或分支并发送 Pull Requests。
许可
GPL3. 请参阅 许可文件 了解更多信息。