fix: svg not supported in image uploads in the editor (#5558)
* fix: svg not supported in image uploads * fix: svg image file error message fixed
This commit is contained in:
parent
5eb868e07d
commit
069f8b950e
2 changed files with 3 additions and 3 deletions
|
|
@ -146,7 +146,7 @@ export const insertImageCommand = (
|
|||
if (range) editor.chain().focus().deleteRange(range).run();
|
||||
const input = document.createElement("input");
|
||||
input.type = "file";
|
||||
input.accept = ".jpeg, .jpg, .png, .webp, .svg";
|
||||
input.accept = ".jpeg, .jpg, .png, .webp";
|
||||
input.onchange = async () => {
|
||||
if (input.files?.length) {
|
||||
const file = input.files[0];
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@ export function isFileValid(file: File): boolean {
|
|||
return false;
|
||||
}
|
||||
|
||||
const allowedTypes = ["image/jpeg", "image/jpg", "image/png", "image/webp", "image/svg+xml"];
|
||||
const allowedTypes = ["image/jpeg", "image/jpg", "image/png", "image/webp"];
|
||||
if (!allowedTypes.includes(file.type)) {
|
||||
alert("Invalid file type. Please select a JPEG, JPG, PNG, WEBP, or SVG image file.");
|
||||
alert("Invalid file type. Please select a JPEG, JPG, PNG, or WEBP image file.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue