forked from cadence/out-of-your-element
Fix bug quoting reply to msg with blockquote
This commit is contained in:
parent
a56942cf14
commit
9e22101f66
2 changed files with 86 additions and 1 deletions
|
@ -348,7 +348,7 @@ async function eventToMessage(event, guild, di) {
|
|||
const repliedToContent = repliedToEvent.content.formatted_body || repliedToEvent.content.body
|
||||
const contentPreviewChunks = chunk(
|
||||
repliedToContent.replace(/.*<\/mx-reply>/, "") // Remove everything before replies, so just use the actual message body
|
||||
.replace(/.*?<\/blockquote>/, "") // If the message starts with a blockquote, don't count it and use the message body afterwards
|
||||
.replace(/<blockquote>.*?<\/blockquote>/, "") // If the message starts with a blockquote, don't count it and use the message body afterwards
|
||||
.replace(/(?:\n|<br>)+/g, " ") // Should all be on one line
|
||||
.replace(/<span [^>]*data-mx-spoiler\b[^>]*>.*?<\/span>/g, "[spoiler]") // Good enough method of removing spoiler content. (I don't want to break out the HTML parser unless I have to.)
|
||||
.replace(/<[^>]+>/g, ""), 50) // Completely strip all other formatting.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue