Conditionaly load plugins based on toolbar options #65
-
DescriptionCurrently, it is possible for a CMS editor to use CKEditor features that perhaps the developer hadn't intended. This is because even if an item isn't present in the toolbar it doesn't mean you can't use that feature and can still use other editor functionality to include certain formatting or content. For example:
I think this is because of the way this plugin loads all of its plugins upfront. ckeditor/src/web/assets/ckeditor/src/ckeditor.js Lines 61 to 105 in fcc641b According to the CKEditor docs things like autoformatting will only work if a related plugin is included e.g. the ** autoformatting shortcut for bold will only work if the Bold plugin is loaded. Would it be possible to conditionally add/remove plugins at runtime based on the toolbar items included? We can manually remove plugins by passing in a custom config but it would be more intuitive if the available features followed the toolbar. return {
removePlugins: [
'AutoImage',
'BlockQuote',
'Code',
'CodeBlock',
'Heading',
'HorizontalLine',
'MediaEmbed',
'TodoList',
'Underline',
],
} Additional info
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Good call! Just made this change for 3.1 (add2c41) 🎉 |
Beta Was this translation helpful? Give feedback.
Good call! Just made this change for 3.1 (add2c41) 🎉