From 9c540fcbce10e6de88dc141a830e93f61a475c67 Mon Sep 17 00:00:00 2001 From: sevonj <100710152+sevonj@users.noreply.github.com> Date: Sun, 21 Jul 2024 15:33:59 +0300 Subject: [PATCH] feat: Recognize m.youtube.com links --- src/lib/components/lemmy/post/helpers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/components/lemmy/post/helpers.ts b/src/lib/components/lemmy/post/helpers.ts index 4be6c93a..549fbce6 100644 --- a/src/lib/components/lemmy/post/helpers.ts +++ b/src/lib/components/lemmy/post/helpers.ts @@ -56,7 +56,7 @@ export const optimizeImageURL = ( } const YOUTUBE_REGEX = - /^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|shorts\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/ + /^(?:https?:\/\/)?(?:www\.|m\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|shorts\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/ export const isYoutubeLink = (url?: string): RegExpMatchArray | null => { if (!url) return null