fix: improve unbookmark url handling

This commit is contained in:
Peter Steinberger
2026-01-05 03:51:56 +01:00
parent 04a0c98362
commit 6fbbaebb68
4 changed files with 12 additions and 6 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
/**
* Extract tweet ID from a Twitter/X URL or return the input unchanged if it's already an ID.
*/
const TWEET_URL_REGEX = /(?:twitter\.com|x\.com)\/\w+\/status\/(\d+)/;
const TWEET_URL_REGEX = /(?:twitter\.com|x\.com)\/(?:\w+\/status|i\/web\/status)\/(\d+)/i;
export function extractTweetId(input: string): string {
// If it's a URL, extract the tweet ID