NoelOConnell / quill-image-uploader

A module for Quill rich text editor to allow images to be uploaded to a server instead of being base64 encoded
MIT License
243 stars 98 forks source link

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

Open Julian367 opened 2 years ago

Julian367 commented 2 years ago

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}
  },
Julian367 commented 2 years ago

Any one have the same problem?

singleseeker commented 1 year ago

I have the same issue here.