Properly hide embeds for links in reply previews
This commit is contained in:
@@ -739,11 +739,11 @@ async function eventToMessage(event, guild, di) {
|
||||
return convertEmoji(mxcUrlMatch?.[1], titleTextMatch?.[1], false, false)
|
||||
})
|
||||
repliedToContent = repliedToContent.replace(/<[^:>][^>]*>/g, "") // Completely strip all HTML tags and formatting.
|
||||
repliedToContent = repliedToContent.replace(/\bhttps?:\/\/[^ )]*/g, "<$&>")
|
||||
repliedToContent = entities.decodeHTML5Strict(repliedToContent) // Remove entities like & "
|
||||
const contentPreviewChunks = chunk(repliedToContent, 50)
|
||||
if (contentPreviewChunks.length) {
|
||||
contentPreview = ": " + contentPreviewChunks[0]
|
||||
contentPreview = contentPreview.replace(/\bhttps?:\/\/[^ )]*/g, "<$&>")
|
||||
if (contentPreviewChunks.length > 1) contentPreview = contentPreview.replace(/[,.']$/, "") + "..."
|
||||
} else {
|
||||
contentPreview = ""
|
||||
|
||||
Reference in New Issue
Block a user