This commit is contained in:
Skip R
2025-12-11 19:55:00 -08:00
parent ab82f8b131
commit 60171b4fca
7 changed files with 17 additions and 12 deletions

View File

@@ -37,7 +37,8 @@ const discordLinkPattern = `https?://[^<\p{Zs}\x{feff}]*[^"'),.:;\]\p{Zs}\x{feff
// don't contain < or whitespace anywhere, and don't end with "'),.:;]
//
// Zero-width whitespace is mostly in the Format category and is allowed, except \uFEFF isn't for some reason
var discordLinkRegex = regexp.MustCompile(discordLinkPattern)
// FIXME(skip): This will be unused until we port `escapeDiscordMarkdown`.
// var discordLinkRegex = regexp.MustCompile(discordLinkPattern)
var discordLinkRegexFull = regexp.MustCompile("^" + discordLinkPattern + "$")
func isActuallyLinkPreview(embed *discordgo.MessageEmbed) bool {