mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
Fixes for mentions being wrong
This commit is contained in:
parent
63f046d281
commit
fde0ff509e
|
|
@ -221,7 +221,7 @@ export const getDescendants = async (
|
|||
*/
|
||||
export const parseTextMentions = async (text: string) => {
|
||||
const mentionedPeople =
|
||||
text.match(/@[a-zA-Z0-9_]+(@[a-zA-Z0-9_]+)?/g) ?? [];
|
||||
text.match(/@[a-zA-Z0-9_]+(@[a-zA-Z0-9_.:]+)?/g) ?? [];
|
||||
|
||||
return await client.user.findMany({
|
||||
where: {
|
||||
|
|
@ -301,6 +301,14 @@ export const createNewStatus = async (
|
|||
|
||||
htmlContent = linkifyHtml(
|
||||
await replaceTextMentions(htmlContent, mentions ?? []),
|
||||
{
|
||||
defaultProtocol: "https",
|
||||
validate: {
|
||||
email: () => false,
|
||||
},
|
||||
target: "_blank",
|
||||
rel: "nofollow noopener noreferrer",
|
||||
},
|
||||
);
|
||||
} else {
|
||||
htmlContent = "";
|
||||
|
|
|
|||
Loading…
Reference in a new issue