Fix url menu showing

This commit is contained in:
Saoud Rizwan
2024-09-17 06:07:58 -04:00
parent b9871310a4
commit d47008f0b4
2 changed files with 20 additions and 8 deletions

View File

@@ -117,6 +117,9 @@ export function shouldShowContextMenu(text: string, position: number): boolean {
// Check if there's any whitespace after the '@'
if (/\s/.test(textAfterAt)) return false
// Show the menu if there's just '@' or '@' followed by some text
// Don't show the menu if it's a URL
if (textAfterAt.toLowerCase().startsWith("http")) return false
// Show the menu if there's just '@' or '@' followed by some text (but not a URL)
return true
}