Skip to content

Commit

Permalink
Ignore pasting images when image format is disallowed
Browse files Browse the repository at this point in the history
  • Loading branch information
luin committed May 13, 2024
1 parent dd62291 commit 2f6bd5c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/quill/src/modules/uploader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ class Uploader extends Module<UploaderOptions> {
Uploader.DEFAULTS = {
mimetypes: ['image/png', 'image/jpeg'],
handler(range: Range, files: File[]) {
if (!this.quill.scroll.query('image')) {
return;
}
const promises = files.map((file) => {
return new Promise((resolve) => {
const reader = new FileReader();
Expand Down

0 comments on commit 2f6bd5c

Please sign in to comment.