feat: replace http nostr links with native nostr links

closes #666
refactor: embeds
This commit is contained in:
2024-09-13 10:52:25 +01:00
parent dd7424f616
commit b5c106d579
13 changed files with 86 additions and 137 deletions

View File

@ -84,9 +84,10 @@ export const InvoiceRegex = /(lnbc\w+)/i;
/**
* YouTube URL regex
* https://music.youtube.com/watch?v=KyF9hKd-EC4&list=RDTMAK5uy_kset8DisdE7LSD4TNjEVvrKRTmG7a56sY
*/
export const YoutubeUrlRegex =
/(?:https?:\/\/)?(?:www|m\.)?(?:youtu\.be\/|youtube\.com\/(?:live\/|shorts\/|embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})/;
/(?:https?:\/\/)?(?:www|m\.)?(?:youtu\.be\/|youtube\.com\/(?:live\/|shorts\/|embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})((?:&list=)(?:(\w|-)+))?/;
/**
* Hashtag regex