kinglozzer / htmleditorscripts
在 SilverStripe 的 HtmlEditorField 中启用 <script> 标签
1.0.1
2015-09-24 13:35 UTC
Requires
- silverstripe/framework: ^3.1
This package is auto-updated.
Last update: 2024-09-04 22:20:21 UTC
README
在 SilverStripe 的 HtmlEditorField
中启用 <script>
标签。这是 这个PR 的一个实现,用于在 3.1 中启用此功能。
安装
composer require kinglozzer/htmleditorscripts
不需要额外的设置,因为这个模块会向 extended_valid_elements
添加 <script>
标签。
注意
- 仅设置与默认 CMS
HtmlEditorConfig
实例一起使用。将_config.php
中的方法复制过来,以在其他配置实例中启用它; - 阻止其他
editor.onSaveContent
插件事件触发:由于我们无法移除去除<script>
标签的 SilverStripe 事件(我们无法在ed.onSaveContent.remove()
中引用变量),我们只能简单地停止其他事件的运行。