diff --git a/core/modules/ckeditor/js/plugins/drupalimage/plugin.js b/core/modules/ckeditor/js/plugins/drupalimage/plugin.js index 64ca8bb..047ae24 100644 --- a/core/modules/ckeditor/js/plugins/drupalimage/plugin.js +++ b/core/modules/ckeditor/js/plugins/drupalimage/plugin.js @@ -51,12 +51,7 @@ var imgAttributes = widgetDefinition.allowedContent.img.attributes.split(/\s*,\s*/); for (var i = 0; i < imgAttributes.length; i++) { // Exclamation marks are only used in the string notation. - if (imgAttributes[i].substr(0, 1) === '!') { - allowedContentDefinition.attributes[imgAttributes[i].substr(1)] = ''; - } - else { - allowedContentDefinition.attributes[imgAttributes[i]] = ''; - } + allowedContentDefinition.attributes[imgAttributes[i].replace(/^!/, '')] = ''; } if (widgetDefinition.allowedContent.img.classes) { allowedContentDefinition.attributes['class'] = widgetDefinition.allowedContent.img.classes.split(/\s*,\s*/).join(' ');