support tiff image

This commit is contained in:
reya 2023-11-01 15:24:46 +07:00
parent 2f8aa66ff6
commit c8d04f4695
2 changed files with 2 additions and 2 deletions

View File

@ -1,5 +1,5 @@
export function fileType(url: string) {
if (url.match(/\.(jpg|jpeg|gif|png|webp|avif)$/)) {
if (url.match(/\.(jpg|jpeg|gif|png|webp|avif|tiff)$/)) {
return 'image';
}

View File

@ -41,7 +41,7 @@ export function parser(content: string) {
const url = new URL(word);
url.search = '';
if (url.pathname.match(/\.(jpg|jpeg|gif|png|webp|avif)$/)) {
if (url.pathname.match(/\.(jpg|jpeg|gif|png|webp|avif|tiff)$/)) {
// image url
richContent.images.push(word);
// remove url from original content