oro/html5-purifier
Composer 安装命令:
composer require oro/html5-purifier
包简介
Adding HTML5 tags support to WYSIWYG editors
README 文档
README
The purpose of this bundle is to add xemlock/htmlpurifier-html5 library support without introducing the BC break.
The library adds support for HTML5 tags to HTMLPurifier.
The bundle also adds the ability to switch between three purification modes:
strict- filter html elements and attributes by white list. Style and iframe elements are not allowed.extended- same as strict but style and iframe elements are allowed.disabled- HTML Purifier is disabled completely.
The modes are switched with html_purifier_mode config setting in package/html5-purifier/Resources/config/oro/app.yml
How to Extend the List of Supported Elements and Attributes in Html5Purifier
Sometimes it may be necessary to add additional elements or attributes to the Html5Purifier config.
To add a custom element, decorate the oro_html5_purifier.html_tag_helper service.
services: ... acme.html_tag_helper: decorates: oro_html5_purifier.html_tag_helper parent: oro_html5_purifier.html_tag_helper calls: # map element - ['setElement', ['map', 'Block', 'Flow', 'Common', true]] # map attributes - ['setAttribute', ['map', 'id', 'ID']] - ['setAttribute', ['map', 'name', 'CDATA']]
Next, add the map element and attributes into the purifier config in the app.yml file in your bundle.
oro_form: wysiwyg: html_allowed_elements: map: attributes: - id - name
Now you can use the map tag and its id and name attributes in all WYSIWYG fields.
oro/html5-purifier 适用场景与选型建议
oro/html5-purifier 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2021 年 04 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 oro/html5-purifier 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 oro/html5-purifier 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: OSL-3.0
- 更新时间: 2021-04-19