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) => {
|
export const parseTextMentions = async (text: string) => {
|
||||||
const mentionedPeople =
|
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({
|
return await client.user.findMany({
|
||||||
where: {
|
where: {
|
||||||
|
|
@ -301,6 +301,14 @@ export const createNewStatus = async (
|
||||||
|
|
||||||
htmlContent = linkifyHtml(
|
htmlContent = linkifyHtml(
|
||||||
await replaceTextMentions(htmlContent, mentions ?? []),
|
await replaceTextMentions(htmlContent, mentions ?? []),
|
||||||
|
{
|
||||||
|
defaultProtocol: "https",
|
||||||
|
validate: {
|
||||||
|
email: () => false,
|
||||||
|
},
|
||||||
|
target: "_blank",
|
||||||
|
rel: "nofollow noopener noreferrer",
|
||||||
|
},
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
htmlContent = "";
|
htmlContent = "";
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue