Timothy Jaeryang Baek 3 月之前
父节点
当前提交
1a6e4c2948
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/lib/components/chat/Messages/Markdown/HTMLToken.svelte

+ 2 - 2
src/lib/components/chat/Messages/Markdown/HTMLToken.svelte

@@ -22,9 +22,9 @@
 {#if token.type === 'html'}
 	{#if html && html.includes('<video')}
 		{@html html}
-	{:else if token.text && token.text.match(/<iframe\s+[^>]*src="https:\/\/www\.youtube\.com\/embed\/([a-zA-Z0-9_-]{11})"[^>]*><\/iframe>/)}
+	{:else if token.text && token.text.match(/<iframe\s+[^>]*src="https:\/\/www\.youtube\.com\/embed\/([a-zA-Z0-9_-]{11})(?:\?[^"]*)?"[^>]*><\/iframe>/)}
 		{@const match = token.text.match(
-			/<iframe\s+[^>]*src="https:\/\/www\.youtube\.com\/embed\/([a-zA-Z0-9_-]{11})"[^>]*><\/iframe>/
+			/<iframe\s+[^>]*src="https:\/\/www\.youtube\.com\/embed\/([a-zA-Z0-9_-]{11})(?:\?[^"]*)?"[^>]*><\/iframe>/
 		)}
 		{@const ytId = match && match[1]}
 		{#if ytId}