Skip to content

Commit d351c9a

Browse files
author
Vladimír Votava
committed
Add @ckeditor5/image-resize as opt-in plugin configuratable by ckeditor config
1 parent 7a366ba commit d351c9a

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

src/web/assets/ckeditor/dist/ckeditor5-craftcms.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/web/assets/ckeditor/dist/ckeditor5-craftcms.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/web/assets/ckeditor/src/ckeditor5-craftcms.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {Alignment} from '@ckeditor/ckeditor5-alignment';
99
import {
1010
AutoImage,
1111
Image,
12+
ImageResize,
1213
ImageCaption,
1314
ImageStyle,
1415
ImageToolbar,
@@ -87,6 +88,7 @@ const allPlugins = [
8788
HtmlComment,
8889
HtmlEmbed,
8990
Image,
91+
ImageResize,
9092
ImageCaption,
9193
ImageStyle,
9294
ImageToolbar,
@@ -565,6 +567,12 @@ export const create = async function (element, config) {
565567
// for more info
566568
removePlugins.push('MediaEmbedToolbar');
567569

570+
// remove ImageResize build-in plugin, if it's not explicitly allowed in config
571+
// see: https://github.com/craftcms/ckeditor/issues/328
572+
if (!config.enableImageResize) {
573+
removePlugins.push('ImageResize');
574+
}
575+
568576
if (removePlugins.length) {
569577
plugins = plugins.filter((p) => !removePlugins.includes(p.pluginName));
570578
}

0 commit comments

Comments
 (0)