forked from cadence/out-of-your-element
m->d: Suppress embeds for links in reply preview
This commit is contained in:
parent
283cf66906
commit
5c48645334
5 changed files with 173 additions and 26 deletions
|
@ -592,6 +592,7 @@ 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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue