fix: spoiler support
This commit is contained in:
1 parent
687bcde97b
commit
14789bd5ba
7 files changed
+85
-60
No files matched your search
+2
-2
@@ -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
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user