m->d: Improve reply preview truncation punctuation
This commit is contained in:
parent
d0a3c3ce29
commit
a67708269d
1 changed files with 2 additions and 2 deletions
|
@ -435,8 +435,8 @@ async function eventToMessage(event, guild, di) {
|
||||||
.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(/<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, "") // Completely strip all HTML tags and formatting.
|
.replace(/<[^>]+>/g, "") // Completely strip all HTML tags and formatting.
|
||||||
), 50)
|
), 50)
|
||||||
contentPreview = ":\n> "
|
contentPreview = ":\n> " + contentPreviewChunks[0]
|
||||||
contentPreview += contentPreviewChunks.length > 1 ? contentPreviewChunks[0] + "..." : contentPreviewChunks[0]
|
if (contentPreviewChunks.length > 1) contentPreview = contentPreview.replace(/[,.']$/, "") + "..."
|
||||||
}
|
}
|
||||||
replyLine = `> ${replyLine}${contentPreview}\n`
|
replyLine = `> ${replyLine}${contentPreview}\n`
|
||||||
})()
|
})()
|
||||||
|
|
Loading…
Reference in a new issue