Skip to content

Commit

Permalink
Update regex to exclude channel URL unfurling (ueberdosis#3750)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustMaier authored and aliasliao committed May 24, 2023
1 parent a387fd8 commit 596e7b7
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 596e7b7

Please sign in to comment.