mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-04 20:36:03 +01:00
🐛 Fix preview and insertion of images with non-lowercase extension
This commit is contained in:
@@ -149,7 +149,7 @@
|
||||
filename = filename.replace(/@3x|@2x|@1x/, '');
|
||||
filename = filename.replace(/\(/g, '%28');
|
||||
filename = filename.replace(/\)/g, '%29');
|
||||
if (filename.match(/\.(jpg|jpeg|png|gif)$/)) {
|
||||
if (filename.toLowerCase().match(/\.(jpg|jpeg|png|gif)$/)) {
|
||||
editor.doc.replaceSelection('');
|
||||
} else {
|
||||
editor.doc.replaceSelection('[' + decodeURI(filename) + '](' + filename + ')');
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
thisDropzone.files.push(mockFile);
|
||||
thisDropzone.options.addedfile.call(thisDropzone, mockFile);
|
||||
|
||||
if (filename.match(/\.(jpg|jpeg|png|gif)$/)) {
|
||||
if (filename.toLowerCase().match(/\.(jpg|jpeg|png|gif)$/)) {
|
||||
thisDropzone.options.thumbnail.call(thisDropzone, mockFile, data.url);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user