cradeq/commonmark-html-whitelist-extension
Composer 安装命令:
composer require cradeq/commonmark-html-whitelist-extension
包简介
Allows HTML tags to be used in Markdown, while still escaping or stripping all other HTML input.
README 文档
README
This package allows any HTML tags to be used in Markdown, while still escaping or stripping all other HTML input. Only tags without attributes or styling are supported. Content of the HTML elements remains intact.
Install
This project can be installed via composer:
composer require cradeq/commonmark-html-whitelist-extension
Usage
use Cradeq\CommonMark\HtmlWhitelistExtension; use League\CommonMark\Environment\Environment; use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension; $environment = new Environment([ 'html_input' => 'strip', // Both strip and escape are supported 'html_whitelist' => [ 'tags' => ['br', 'sub'], // Any set of html tags ], ]); $environment->addExtension(new CommonMarkCoreExtension); $environment->addExtension(new HtmlWhitelistExtension);
统计信息
- 总下载量: 8.6k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-12-04