Fix for url previews

This commit is contained in:
Christopher
2026-01-22 13:25:15 -08:00
parent 67a97ea8c4
commit fc86bc1901
2 changed files with 14 additions and 8 deletions
+1 -1
View File
@@ -230,7 +230,7 @@ function Compose({ onPost }: { onPost: (content: string, mediaIds: string[], lin
// Detect URLs in content
useEffect(() => {
const urlRegex = /(?:https?:\/\/)?(?:www\.)?([a-zA-Z0-9-]+\.[a-zA-Z0-9.-]+\.[a-z]{2,63})\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/gi;
const urlRegex = /(?:https?:\/\/)?((?:[a-zA-Z0-9-]+\.)+[a-z]{2,63})\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/gi;
const matches = content.match(urlRegex);
if (matches && matches[0]) {