Add the @ sign in the other order

This commit is contained in:
Cadence Ember 2024-01-22 23:36:19 +13:00
parent 4591b5ae03
commit c084aa0156
1 changed files with 2 additions and 2 deletions

View File

@ -108,9 +108,9 @@ turndownService.addRule("inlineLink", {
if (node.getAttribute("data-channel-id")) return `<#${node.getAttribute("data-channel-id")}>`
const href = node.getAttribute("href")
let brackets = ["", ""]
if (href.startsWith("https://matrix.to")) brackets = ["<", ">"]
if (href.startsWith("https://matrix.to/#/@")) content = "@" + content
content = content.replace(/ @.*/, "")
if (href.startsWith("https://matrix.to")) brackets = ["<", ">"]
if (href.startsWith("https://matrix.to/#/@") && content[0] !== "@") content = "@" + content
return "[" + content + "](" + brackets[0] + href + brackets[1] + ")"
}
})