NoelOConnell/quill-image-uploader

Copy and paste from Word into the pen editor, insert an image instead of text

Julian367 opened this issue · 2 comments

Paste from Word is making a photo instead of pasting just text. This happen only on Google Chrome

setup: () => {
    const modules = [{
      name: 'imageUploader',
      module: ImageUploader,
      options: {
        upload: file => {
          return new Promise((resolve, reject) => {
            let Image = Quill.import('formats/image');
            Image.className = 'img-fluid';
            Quill.register(Image, true);
            const formData = new FormData();
            formData.append("image", file);
            axios({
              url: '/api/upload-image',
              method: 'POST',
              data: formData
            }).then((result) => {
              resolve(result.data.url);
              let url = result.data.url;
            }).catch((err) => {
              reject("Upload failed");
              console.error("Error:", error);
            })
          });
        }
      }
    }
    ]
    return {modules}
  },

Any one have the same problem?