Don't replace text mentions twice

This commit is contained in:
Jesse Wierzbinski 2024-04-10 12:41:06 -10:00
parent fde0ff509e
commit 742913a911
No known key found for this signature in database

View file

@ -299,17 +299,14 @@ export const createNewStatus = async (
.map((line) => `<p>${line}</p>`) .map((line) => `<p>${line}</p>`)
.join("\n"); .join("\n");
htmlContent = linkifyHtml( htmlContent = linkifyHtml(htmlContent, {
await replaceTextMentions(htmlContent, mentions ?? []),
{
defaultProtocol: "https", defaultProtocol: "https",
validate: { validate: {
email: () => false, email: () => false,
}, },
target: "_blank", target: "_blank",
rel: "nofollow noopener noreferrer", rel: "nofollow noopener noreferrer",
}, });
);
} else { } else {
htmlContent = ""; htmlContent = "";
} }