SaaS CMS has officially launched! Learn more now.

Internal style tags getting stripped in TinyMCE editor



The TinyMCE editor is removing the internal CSS from the 'code' view. Is there any configuration to tell TintMCE to not strip the internal style tags within the code view?

TinyMCE version: 4.9.11

May 25, 2021 4:46

What do you mean be INTERNAL style tags?

Could you give an example of the markup you are trying to add, and what it looks like after TinyMCE have stripped away some of it?

May 25, 2021 11:50

Hi Syed,

Create an initialization module and use this code-

using EPiServer.Cms.TinyMce.Core;
using EPiServer.Framework;
using EPiServer.Framework.Initialization;
using EPiServer.ServiceLocation;

namespace ABC.Framework.Web.Business.Initialization
    public class TinymceCustomInitialization : IConfigurableModule
        public void ConfigureContainer(ServiceConfigurationContext context)
            // browser console to see settings: window.tinymce.settings;

            context.Services.Configure<TinyMceConfiguration>(config =>
                    .AddSetting("valid_children", "+body[style]").AddSetting("extended_valid_elements", "script[language|type|src]");

        public void Initialize(InitializationEngine context) { }

        public void Uninitialize(InitializationEngine context) { }
May 26, 2021 8:06
Syed Quadri - May 27, 2021 6:31
Thanks.It worked.
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.