mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-07-03 08:04:29 -06:00
Accept AVIF for image uploads
This commit is contained in:
parent
2b178671ca
commit
b31cf2bf7c
@ -917,7 +917,7 @@ function afterImageUploaded(editor, url) {
|
|||||||
var ext = imageName.substring(imageName.lastIndexOf('.') + 1).replace(/\?.*$/, '').toLowerCase();
|
var ext = imageName.substring(imageName.lastIndexOf('.') + 1).replace(/\?.*$/, '').toLowerCase();
|
||||||
|
|
||||||
// Check if media is an image
|
// Check if media is an image
|
||||||
if (['png', 'jpg', 'jpeg', 'gif', 'svg', 'webp'].includes(ext)) {
|
if (['png', 'jpg', 'jpeg', 'gif', 'svg', 'avif', 'webp'].includes(ext)) {
|
||||||
_replaceSelection(cm, stat.image, options.insertTexts.uploadedImage, url);
|
_replaceSelection(cm, stat.image, options.insertTexts.uploadedImage, url);
|
||||||
} else {
|
} else {
|
||||||
var text_link = options.insertTexts.link;
|
var text_link = options.insertTexts.link;
|
||||||
@ -1832,7 +1832,7 @@ function EasyMDE(options) {
|
|||||||
// Import-image default configuration
|
// Import-image default configuration
|
||||||
options.uploadImage = options.uploadImage || false;
|
options.uploadImage = options.uploadImage || false;
|
||||||
options.imageMaxSize = options.imageMaxSize || 2097152; // 1024 * 1024 * 2
|
options.imageMaxSize = options.imageMaxSize || 2097152; // 1024 * 1024 * 2
|
||||||
options.imageAccept = options.imageAccept || 'image/png, image/jpeg, image/gif';
|
options.imageAccept = options.imageAccept || 'image/png, image/jpeg, image/gif, image/avif';
|
||||||
options.imageTexts = extend({}, imageTexts, options.imageTexts || {});
|
options.imageTexts = extend({}, imageTexts, options.imageTexts || {});
|
||||||
options.errorMessages = extend({}, errorMessages, options.errorMessages || {});
|
options.errorMessages = extend({}, errorMessages, options.errorMessages || {});
|
||||||
options.imagePathAbsolute = options.imagePathAbsolute || false;
|
options.imagePathAbsolute = options.imagePathAbsolute || false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user