From c8d04f46955316584c5416d4ef3621b4df7e2fd4 Mon Sep 17 00:00:00 2001 From: reya Date: Wed, 1 Nov 2023 15:24:46 +0700 Subject: [PATCH] support tiff image --- src/utils/nip94.ts | 2 +- src/utils/parser.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/nip94.ts b/src/utils/nip94.ts index 8582a319..c22ad6d9 100644 --- a/src/utils/nip94.ts +++ b/src/utils/nip94.ts @@ -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'; } diff --git a/src/utils/parser.ts b/src/utils/parser.ts index 42d1fac4..296f93e2 100644 --- a/src/utils/parser.ts +++ b/src/utils/parser.ts @@ -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