m->d: Improve reply preview truncation punctuation

This commit is contained in:
Cadence Ember 2024-01-10 22:46:20 +13:00
parent d0a3c3ce29
commit a67708269d
1 changed files with 2 additions and 2 deletions

View File

@ -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(/<[^>]+>/g, "") // Completely strip all HTML tags and formatting.
), 50)
contentPreview = ":\n> "
contentPreview += contentPreviewChunks.length > 1 ? contentPreviewChunks[0] + "..." : contentPreviewChunks[0]
contentPreview = ":\n> " + contentPreviewChunks[0]
if (contentPreviewChunks.length > 1) contentPreview = contentPreview.replace(/[,.']$/, "") + "..."
}
replyLine = `> ${replyLine}${contentPreview}\n`
})()