Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
torn4dom4n committed Feb 21, 2024
1 parent 80b010b commit 9fa0c7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/YouTube.astro
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface Props extends astroHTML.JSX.HTMLAttributes {
const { id, poster, ...attrs } = Astro.props as Props
const urlPattern =
/(?=(\s*))\1(?:<a [^>]*?>)??(?=(\s*))\2(?:https?:\/\/)??(?:w{3}\.)??(?:youtube\.com|youtu\.be)\/(?:watch\?v=|embed\/)??([A-Za-z0-9-_]{11})(?:[^\s<>]*)(?=(\s*))\4(?:<\/a>)??(?=(\s*))\5/
/(?=(\s*))\1(?:<a [^>]*?>)??(?=(\s*))\2(?:https?:\/\/)??(?:w{3}\.)??(?:youtube\.com|youtu\.be)\/(?:watch\?v=|embed\/|shorts\/)??([A-Za-z0-9-_]{11})(?:[^\s<>]*)(?=(\s*))\4(?:<\/a>)??(?=(\s*))\5/
function urlMatcher(url: string): string | undefined {
const match = url.match(urlPattern)
Expand Down

0 comments on commit 9fa0c7a

Please sign in to comment.