From 7730e321a58d808f2610c7c08606f1d0c4034524 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sat, 22 Nov 2025 20:36:01 -0300 Subject: [PATCH] nip27: support more image, audio and video extensions. --- nip27.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nip27.ts b/nip27.ts index 823e308..1a65490 100644 --- a/nip27.ts +++ b/nip27.ts @@ -131,19 +131,19 @@ export function* parse(content: string | NostrEvent): Iterable { yield { type: 'text', text: content.slice(prevIndex, u - prefixLen) } } - if (/\.(png|jpe?g|gif|webp)$/i.test(url.pathname)) { + if (/\.(png|jpe?g|gif|webp|heic|svg)$/i.test(url.pathname)) { yield { type: 'image', url: url.toString() } index = end prevIndex = index continue mainloop } - if (/\.(mp4|avi|webm|mkv)$/i.test(url.pathname)) { + if (/\.(mp4|avi|webm|mkv|mov)$/i.test(url.pathname)) { yield { type: 'video', url: url.toString() } index = end prevIndex = index continue mainloop } - if (/\.(mp3|aac|ogg|opus)$/i.test(url.pathname)) { + if (/\.(mp3|aac|ogg|opus|wav|flac)$/i.test(url.pathname)) { yield { type: 'audio', url: url.toString() } index = end prevIndex = index