@@ -75,6 +75,11 @@ const insertFiles = function (
|
|||||||
const { tr } = view.state;
|
const { tr } = view.state;
|
||||||
|
|
||||||
if (upload.isImage) {
|
if (upload.isImage) {
|
||||||
|
// Skip if the editor does not support images.
|
||||||
|
if (!view.state.schema.nodes.image) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// insert a placeholder at this position, or mark an existing file as being
|
// insert a placeholder at this position, or mark an existing file as being
|
||||||
// replaced
|
// replaced
|
||||||
tr.setMeta(uploadPlaceholderPlugin, {
|
tr.setMeta(uploadPlaceholderPlugin, {
|
||||||
@@ -88,6 +93,11 @@ const insertFiles = function (
|
|||||||
});
|
});
|
||||||
view.dispatch(tr);
|
view.dispatch(tr);
|
||||||
} else if (!attachmentPlaceholdersSet) {
|
} else if (!attachmentPlaceholdersSet) {
|
||||||
|
// Skip if the editor does not support attachments.
|
||||||
|
if (!view.state.schema.nodes.attachment) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
const attachmentsToUpload = filesToUpload.filter(
|
const attachmentsToUpload = filesToUpload.filter(
|
||||||
(i) => i.isImage === false
|
(i) => i.isImage === false
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user