FIX: Composer upload icon regression because of WEBP (#11959)
Similar to
ba9fbb3443
Reported on
https://meta.discourse.org/t/image-icon-has-changed-to-upload-icon/178247?u=falco
This commit is contained in:
parent
e7ca1ed6bf
commit
d518b302a0
|
@ -56,7 +56,7 @@ export default Controller.extend(ModalFunctionality, {
|
|||
const imageUrl = this.imageUrl || "";
|
||||
const toolbarEvent = this.toolbarEvent;
|
||||
|
||||
if (imageUrl.match(/\.(jpg|jpeg|png|gif|heic|heif)$/)) {
|
||||
if (imageUrl.match(/\.(jpg|jpeg|png|gif|heic|heif|webp)$/)) {
|
||||
toolbarEvent.addText(`![](${imageUrl})`);
|
||||
} else {
|
||||
toolbarEvent.addText(imageUrl);
|
||||
|
|
|
@ -118,7 +118,7 @@ function validateUploadedFile(file, opts) {
|
|||
return true;
|
||||
}
|
||||
|
||||
const IMAGES_EXTENSIONS_REGEX = /(png|jpe?g|gif|svg|ico|heic|heif)/i;
|
||||
const IMAGES_EXTENSIONS_REGEX = /(png|jpe?g|gif|svg|ico|heic|heif|webp)/i;
|
||||
|
||||
function extensionsToArray(exts) {
|
||||
return exts
|
||||
|
@ -182,7 +182,7 @@ export function authorizedExtensions(staff, siteSettings) {
|
|||
|
||||
function authorizedImagesExtensions(staff, siteSettings) {
|
||||
return authorizesAllExtensions(staff, siteSettings)
|
||||
? "png, jpg, jpeg, gif, svg, ico, heic, heif"
|
||||
? "png, jpg, jpeg, gif, svg, ico, heic, heif, webp"
|
||||
: imagesExtensions(staff, siteSettings).join(", ");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue