Begin adding server-side autocomplete to web client

This commit is contained in:
Phillip Thelen
2018-11-26 15:47:22 +01:00
parent aae2fb1cb9
commit e9c86622c5
5 changed files with 161 additions and 28 deletions

View File

@@ -15,7 +15,7 @@ export async function highlightMentions (text) {
.exec();
members.forEach((member) => {
const username = member.auth.local.username;
text = text.replace(new RegExp(`@${username}\\b`, 'g'), `[@${username}](https://habitica.com/members/${member._id})`);
text = text.replace(new RegExp(`@${username}\\b`, 'g'), `[@${username}](/members/${member._id})`);
});
}
return text;