Handle Webp Image Uploads

With this fix, uploaded WebP images render as links in the markdown (vs images).
pull/417/head
Salem Cobalt 2 years ago committed by GitHub
parent 76fda35bf9
commit bf9b0108d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -901,7 +901,7 @@ function afterImageUploaded(editor, url) {
var ext = imageName.substring(imageName.lastIndexOf('.') + 1).replace(/\?.*$/, '').toLowerCase();
// Check if media is an image
if (['png', 'jpg', 'jpeg', 'gif', 'svg'].includes(ext)) {
if (['png', 'jpg', 'jpeg', 'gif', 'svg', 'webp'].includes(ext)) {
_replaceSelection(cm, stat.image, options.insertTexts.uploadedImage, url);
} else {
var text_link = options.insertTexts.link;

Loading…
Cancel
Save