Allow <style> in HTMLEditor

Silverstripe Version: 4.9.0

Question: There is any way to allow inserting <style> tag to HTMLEditor

i would like to add possibility for inserting the <style> tag in HTMLEditor unfortunately, I am unable to achieve this, i try something like this:

// app/_config.php
HtmlEditorConfig::get('cms')->setOption(
    'extended_valid_elements', 'style[type]'
);

HtmlEditorConfig::get('cms')->setOption(
    'valid_children ','+body[style]'
);

there is no mention of this in the documentation. Is it possible at all?

In my situation i can disable all validation for HTMLEditor if its possible :slight_smile: but i dont know how to make it too.

This is really more of a tinymce question than a silverstripe question at the end of the day. All options you set using HtmlEditorConfig::setOption() are just normal tinymce options.

I found a relevant answer on stackoverflow that seems to work: css - TinyMCE is removing <style> tags - Stack Overflow