kinglozzer / htmleditorscripts
Enable <script> tags in SilverStripe’s HtmlEditorField
Installs: 1 098
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
Language:JavaScript
Type:silverstripe-module
pkg:composer/kinglozzer/htmleditorscripts
Requires
- silverstripe/framework: ^3.1
This package is auto-updated.
Last update: 2025-10-05 00:37:00 UTC
README
Enable <script> tags in SilverStripe’s HtmlEditorField. An implementation of this PR to enable this functionality in 3.1.
Installation
composer require kinglozzer/htmleditorscripts
No extra setup is needed as this module adds <script> tags to extended_valid_elements.
Notes
- Only set up to work with the default CMS
HtmlEditorConfiginstance. Copy the approach in_config.phpto enable it in other config instances; - Prevents other
editor.onSaveContentplugin events firing: as we can’t remove the SilverStripe event that strips the<script>tags (as we don’t have a variable to reference ined.onSaveContent.remove()), we have to simply stop other events from running.