From 497ab4b89f6888cb9a449ad2cd4273511d26aed8 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Fri, 17 Mar 2023 11:09:31 -0400 Subject: [PATCH] fix: YouTube links with timestamp cannot be embedded, closes #5051 --- shared/editor/embeds/YouTube.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/shared/editor/embeds/YouTube.tsx b/shared/editor/embeds/YouTube.tsx index 3df4c53b7..f39c503cc 100644 --- a/shared/editor/embeds/YouTube.tsx +++ b/shared/editor/embeds/YouTube.tsx @@ -5,17 +5,21 @@ import { EmbedProps as Props } from "."; function YouTube(props: Props) { const { matches } = props.attrs; const videoId = matches[1]; + const queryParameters = matches[2]; + return ( ); } YouTube.ENABLED = [ - /(?:https?:\/\/)?(?:www\.)?youtu\.?be(?:\.com)?\/?.*(?:watch|embed)?(?:.*v=|v\/|\/)([a-zA-Z0-9_-]{11})$/i, + /(?:https?:\/\/)?(?:www\.)?youtu\.?be(?:\.com)?\/?.*(?:watch|embed)?(?:.*v=|v\/|\/)([a-zA-Z0-9_-]{11})(?:\?)?(.*)?$/i, ]; export default YouTube;