mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-07-01 23:24:28 -06:00
Merge pull request #357 from ukjinjang/fix/compare_image_extension
Convert media file extension to lowercase before check if image
This commit is contained in:
commit
cda237031f
@ -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)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user