diff --git a/src/lib/components/chat/Messages/Markdown/HTMLToken.svelte b/src/lib/components/chat/Messages/Markdown/HTMLToken.svelte new file mode 100644 index 000000000..66ca2ea30 --- /dev/null +++ b/src/lib/components/chat/Messages/Markdown/HTMLToken.svelte @@ -0,0 +1,49 @@ + + +{#if token.type === 'html'} + {#if html && html.includes(']*src="https:\/\/www\.youtube\.com\/embed\/([a-zA-Z0-9_-]{11})"[^>]*><\/iframe>/)} + {@const match = token.text.match( + /]*src="https:\/\/www\.youtube\.com\/embed\/([a-zA-Z0-9_-]{11})"[^>]*><\/iframe>/ + )} + {@const ytId = match && match[1]} + {#if ytId} + + {/if} + {:else if token.text.includes(`