2
0
mirror of https://github.com/Ionaru/easy-markdown-editor synced 2025-07-18 23:44:29 -06:00

fix: convert media file extension to lowercase before check if image

This commit is contained in:
Uk-Jin Jang 2021-10-05 15:50:48 +09:00
parent 0f559258c5
commit b121795887

View File

@ -866,7 +866,7 @@ function afterImageUploaded(editor, url) {
var stat = getState(cm);
var options = editor.options;
var imageName = url.substr(url.lastIndexOf('/') + 1);
var ext = imageName.substring(imageName.lastIndexOf('.') + 1).replace(/\?.*$/, '');
var ext = imageName.substring(imageName.lastIndexOf('.') + 1).replace(/\?.*$/, '').toLowerCase();
// Check if media is an image
if (['png', 'jpg', 'jpeg', 'gif', 'svg'].includes(ext)) {