From 04e89a24082f7c2516001f947c47481cb0b56055 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Tue, 22 Dec 2020 13:33:24 +0100 Subject: [PATCH] edit/page: disable image size attributes in editor Disallow width and height, with Advanced Content Filtering enabled following . --- edit/page.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/edit/page.js b/edit/page.js index d5a2d50..21ec6b4 100644 --- a/edit/page.js +++ b/edit/page.js @@ -119,10 +119,20 @@ CKEDITOR.on('instanceCreated', function (event) { var config = editor.config; config.language = 'nl'; config.extraPlugins = 'inlinesave,placeholder,image2,uploadimage'; - config.allowedContent = true; + config.removePlugins = 'image'; // conflicts with image2 + config.allowedContent = { + $1: { + elements: CKEDITOR.dtd, + attributes: true, + styles: true, + classes: true, + }, + }; + config.disallowedContent = 'img[width,height]'; config.entities = false; // keep unicode config.filebrowserImageUploadUrl = '/edit/page?output=ckjson'; config.image2_alignClasses = ['left', 'center', 'right']; + config.image2_prefillDimensions = false; config.image2_disableResizer = true; config.stylesSet = [ { name: 'Paginakop', element: 'h2' }, -- 2.30.0