Consistently add @ to m->d matrix mentions

This commit is contained in:
Cadence Ember 2024-07-31 00:06:32 +12:00
commit 2c3b653b54
2 changed files with 2 additions and 2 deletions

View file

@ -129,7 +129,7 @@ turndownService.addRule("inlineLink", {
const href = node.getAttribute("href")
content = content.replace(/ @.*/, "")
if (href === content) return href
if (href.startsWith("https://matrix.to/#/@") && content[0] !== "@") content = "@" + content
if (decodeURIComponent(href).startsWith("https://matrix.to/#/@") && content[0] !== "@") content = "@" + content
return "[" + content + "](" + href + ")"
}
})