mirror of
https://gitdab.com/cadence/out-of-your-element.git
synced 2025-09-10 12:22:50 +02:00
Use small text for m->d replies
This commit is contained in:
parent
541c5e1eb5
commit
a6251e850c
2 changed files with 39 additions and 39 deletions
|
@ -541,7 +541,7 @@ 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)
|
||||
replyLine = "> " + contentPreviewChunks[0]
|
||||
replyLine = "> -# " + contentPreviewChunks[0]
|
||||
if (contentPreviewChunks.length > 1) replyLine = replyLine.replace(/[,.']$/, "") + "..."
|
||||
replyLine += "\n"
|
||||
return
|
||||
|
@ -595,14 +595,14 @@ async function eventToMessage(event, guild, di) {
|
|||
repliedToContent = entities.decodeHTML5Strict(repliedToContent) // Remove entities like & "
|
||||
const contentPreviewChunks = chunk(repliedToContent, 50)
|
||||
if (contentPreviewChunks.length) {
|
||||
contentPreview = ":\n> " + contentPreviewChunks[0]
|
||||
contentPreview = ":\n> -# " + contentPreviewChunks[0]
|
||||
if (contentPreviewChunks.length > 1) contentPreview = contentPreview.replace(/[,.']$/, "") + "..."
|
||||
} else {
|
||||
console.log("Unable to generate reply preview for this replied-to event because we stripped all of it:", repliedToEvent)
|
||||
contentPreview = ""
|
||||
}
|
||||
}
|
||||
replyLine = `> ${replyLine}${contentPreview}\n`
|
||||
replyLine = `> -# ${replyLine}${contentPreview}\n`
|
||||
})()
|
||||
|
||||
if (event.content.format === "org.matrix.custom.html" && event.content.formatted_body) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue