Skip to content

Commit

Permalink
Update regex to exclude channel URL unfurling (#3750)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustMaier authored Feb 18, 2023
1 parent 4b1fb1c commit 4cd35d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/extension-youtube/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const YOUTUBE_REGEX = /^(https?:\/\/)?(www\.|music\.)?(youtube\.com|youtu\.be)(.+)?$/
export const YOUTUBE_REGEX_GLOBAL = /^(https?:\/\/)?(www\.|music\.)?(youtube\.com|youtu\.be)(.+)?$/g
export const YOUTUBE_REGEX = /^(https?:\/\/)?(www\.|music\.)?(youtube\.com|youtu\.be)(?!.*\/channel\/)(?!\/@)(.+)?$/
export const YOUTUBE_REGEX_GLOBAL = /^(https?:\/\/)?(www\.|music\.)?(youtube\.com|youtu\.be)(?!.*\/channel\/)(?!\/@)(.+)?$/g

export const isValidYoutubeUrl = (url: string) => {
return url.match(YOUTUBE_REGEX)
Expand Down

0 comments on commit 4cd35d4

Please sign in to comment.