diff --git a/cms/envs/common.py b/cms/envs/common.py index 10aaa3d09689..cb5e32491f7c 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -1243,6 +1243,8 @@ ##### custom vendor plugin variables ##### # JavaScript code can access this data using `process.env.JS_ENV_EXTRA_CONFIG` # One of the current use cases for this is enabling custom TinyMCE plugins +# (TINYMCE_ADDITIONAL_PLUGINS) and overriding the TinyMCE configuration +# (TINYMCE_CONFIG_OVERRIDES). JS_ENV_EXTRA_CONFIG = {} ############################### PIPELINE ####################################### diff --git a/xmodule/js/src/html/edit.js b/xmodule/js/src/html/edit.js index bb92d8c848d9..88863d8e2a03 100644 --- a/xmodule/js/src/html/edit.js +++ b/xmodule/js/src/html/edit.js @@ -208,6 +208,12 @@ } }); } + + // apply configuration overrides if have been defined + var tinyMceConfigOverrides = process.env.JS_ENV_EXTRA_CONFIG.TINYMCE_CONFIG_OVERRIDES; + if (tinyMceConfigOverrides) { + Object.assign(tinyMceConfig, tinyMceConfigOverrides); + } } this.tiny_mce_textarea = $(".tiny-mce", this.element).tinymce(tinyMceConfig);