Ionaru / easy-markdown-editor

EasyMDE: A simple, beautiful, and embeddable JavaScript Markdown editor. Delightful editing for beginners and experts alike. Features built-in autosaving and spell checking.
https://stackblitz.com/edit/easymde
MIT License
2.32k stars 308 forks source link

Copy / paste or upload an an image without a image extension (.png,.gif etc ...) is treated as a link #498

Open superseby2 opened 1 year ago

superseby2 commented 1 year ago

Is your feature request related to a problem? Please describe. I am using Appwrite as backend. Appwrite provides a storage engine that allows you to store any files. To retrieve them the link is something like [domain/project/view?id=8989890809

When pasting an image, I am using Appwrite to store it then retrieve the generated link which is passed to EasyMDE. EasyMDE considers it as link since there is no extension it recognized.

Describe the solution you'd like 2 solutions: one being less painful :smile:

Solution 1 (the painful one): EasyMDE is fetching the content to use its mime-type and make the proper decision about whether this is an image

Solution 2 : being able to call the success callback function from the imageUploadFunction with a additional parameter to specify that this is an image . i.e : instead of onSucces(url) -> onSuccess(url,thisIsAnImage)

Solution 3 : anything better :)

sinwailam193 commented 7 months ago

Hello is there anyway we can specify the extension instead of via the url?