fix: spoiler support

This commit is contained in:
Xylight committed 2024-08-02 13:12:38 -07:00
1 parent 687bcde97b
commit 14789bd5ba
7 files changed
+85 -60

No files matched your search

+2 -2
View File
@@ -2,7 +2,7 @@ export const isImage = (url: string | undefined) => {
try {
if (!url) return false
return /\.(jpeg|jpg|gif|png|svg|bmp|webp)$/i.test(new URL(url).pathname)
return /\.(jpeg|jpg|gif|png|svg|bmp|webp)$/i.test(url)
} catch (err) {
return false
}
@@ -12,7 +12,7 @@ export const isVideo = (url: string | undefined) => {
try {
if (!url) return false
return /\.(mp4|mov|webm|mkv)$/i.test(new URL(url).pathname)
return /\.(mp4|mov|webm|mkv)$/i.test(url)
} catch (err) {
return false
}