chenjuneking / quill-image-drop-and-paste

A quill editor module for drop and paste image, with a callback hook before insert image into the editor
ISC License
101 stars 42 forks source link

Network Request happens on every url added #46

Closed MuaazOsaidTahir closed 1 year ago

MuaazOsaidTahir commented 1 year ago

A network request is sent whenever a URL is pasted in the editor. & if the URL is of an image it is replaced with an image. which is not the behavior I need. Can there be any workaround to run this function urlIsImage optionally? Can a parameter be passed to use this functionality depending on the use case?

image

chenjuneking commented 1 year ago

Hello, @MuaazOsaidTahir , please set the autoConvert option to false and make sure the library's version is ^v1.3.0.

var quill = new Quill('#editor-container', {
  modules: {
    imageDropAndPaste: {
      autoConvert: false,
      handler: imageHandler,
    },
  },
  placeholder: 'Copy & paste, or drag an image here...',
  // ...
})
MuaazOsaidTahir commented 1 year ago

Thank you @chenjuneking . Will test it out & let you know. Closing the issue for now & if there'll be any query I'll definitely ask it later.