Skip to content

Commit 7f8b4b5

Browse files
committed
fix(sanity): support youtube.com/live/ and shorts/ in youtubeParser
1 parent 22a244b commit 7f8b4b5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎apps/sanity/lib/utils.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export function youtubeParser(url: string): string | null {
66
const trimmed = url.trim();
77
if (/^[a-zA-Z0-9_-]{11}$/.test(trimmed)) return trimmed;
88
const regExp =
9-
/^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/;
9+
/^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|live\/|shorts\/|watch\?v=|&v=)([^#&?]*).*/;
1010
const match = trimmed.match(regExp);
1111
return match && match[2].length === 11 ? match[2] : null;
1212
}

0 commit comments

Comments
 (0)