diff --git a/web/components/editor/embed-modal.tsx b/web/components/editor/embed-modal.tsx index 55b72d19..6acfd8f0 100644 --- a/web/components/editor/embed-modal.tsx +++ b/web/components/editor/embed-modal.tsx @@ -1,4 +1,5 @@ import { Editor } from '@tiptap/react' +import { DOMAIN } from 'common/envs/constants' import { useState } from 'react' import { Button } from '../button' import { RichContent } from '../editor' @@ -39,6 +40,19 @@ const embedPatterns: EmbedPattern[] = [ rewrite: (id) => ``, }, + // Twitch is a bit annoying, since it requires the `&parent=DOMAIN` to match + { + // Twitch: https://www.twitch.tv/videos/1445087149 + regex: /^https?:\/\/www\.twitch\.tv\/videos\/(\d+)/, + rewrite: (id) => + ``, + }, + { + // Twitch: https://www.twitch.tv/sirsalty + regex: /^https?:\/\/www\.twitch\.tv\/([^\/]+)/, + rewrite: (channel) => + ``, + }, { regex: /^(https?:\/\/.*)/, rewrite: (url) => ``,