From d6c83d2e0656084516b3635f1d6d5bb9be9c5f55 Mon Sep 17 00:00:00 2001 From: sevonj <100710152+sevonj@users.noreply.github.com> Date: Tue, 23 Jul 2024 23:15:38 +0300 Subject: [PATCH] fix: m.youtube.com embeds broken --- src/lib/components/lemmy/post/media/PostIframe.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/components/lemmy/post/media/PostIframe.svelte b/src/lib/components/lemmy/post/media/PostIframe.svelte index 192ebffa..a5ad650f 100644 --- a/src/lib/components/lemmy/post/media/PostIframe.svelte +++ b/src/lib/components/lemmy/post/media/PostIframe.svelte @@ -15,7 +15,7 @@ function youtubeVideoID(url: string): string | null { const 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+)?$/ const match = url.match(regex) if (match && match[1]) {