forked from cadence/out-of-your-element
m->d: Strip colons from user mentions
This commit is contained in:
parent
afbbe0da3d
commit
e73de60d77
2 changed files with 35 additions and 1 deletions
|
@ -401,6 +401,10 @@ async function eventToMessage(event, guild, di) {
|
|||
return `${attributeValue} data-channel-id="${channelID}">`
|
||||
})
|
||||
|
||||
// Stripping colons after mentions
|
||||
input = input.replace(/( data-user-id.*?<\/a>):?/g, "$1")
|
||||
input = input.replace(/("https:\/\/matrix.to.*?<\/a>):?/g, "$1")
|
||||
|
||||
// Element adds a bunch of <br> before </blockquote> but doesn't render them. I can't figure out how this even works in the browser, so let's just delete those.
|
||||
input = input.replace(/(?:\n|<br ?\/?>\s*)*<\/blockquote>/g, "</blockquote>")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue