Skip to content
Snippets Groups Projects
Unverified Commit 6bc8777a authored by Manuel Leduc's avatar Manuel Leduc Committed by GitHub
Browse files

XWIKI-22146: Black square when drag-and-dropping an image in WYSIWYG (#3102)

parent 9803cdb9
No related branches found
No related tags found
No related merge requests found
......@@ -173,7 +173,15 @@
event.data.dataValue.filter(new CKEDITOR.htmlParser.filter({
elements: {
img: function (element) {
delete element.attributes['data-widget'];
const dataWidgetAttribute = element.attributes['data-widget'];
const dataCkeUploadIdAttribute = element.attributes['data-cke-upload-id'];
const isUploadImageWidget = dataWidgetAttribute === 'uploadimage';
// Cleanup data-widget attributes on images. Except for 'uploadimage' which is only cleaned up when
// the image is not currently being uploaded (i.e., has a data-cke-upload-id attribute)
if (!isUploadImageWidget || dataCkeUploadIdAttribute === undefined)
{
delete element.attributes['data-widget'];
}
}
}
}));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment