forked from cadence/out-of-your-element
m->d avoid using blockquote as reply preview
This commit is contained in:
parent
efa0171172
commit
aa263d3eb8
3 changed files with 53 additions and 5 deletions
|
@ -210,7 +210,7 @@ async function eventToMessage(event, guild, di) {
|
|||
replyLine += `Ⓜ️**${senderName}**:`
|
||||
}
|
||||
const repliedToContent = repliedToEvent.content.formatted_body || repliedToEvent.content.body
|
||||
const contentPreviewChunks = chunk(repliedToContent.replace(/.*<\/mx-reply>/, "").replace(/(?:\n|<br>)+/g, " ").replace(/<[^>]+>/g, ""), 50)
|
||||
const contentPreviewChunks = chunk(repliedToContent.replace(/.*<\/mx-reply>/, "").replace(/.*?<\/blockquote>/, "").replace(/(?:\n|<br>)+/g, " ").replace(/<[^>]+>/g, ""), 50)
|
||||
const contentPreview = contentPreviewChunks.length > 1 ? contentPreviewChunks[0] + "..." : contentPreviewChunks[0]
|
||||
replyLine = `> ${replyLine}\n> ${contentPreview}\n`
|
||||
})()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue