mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 06:07:21 +01:00
Fix issue with username highlighting
This commit is contained in:
@@ -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}](/members/${member._id})`);
|
||||
text = text.replace(new RegExp(`@${username}(?![\\-\\w])`, 'g'), `[@${username}](/profile/${member._id})`);
|
||||
});
|
||||
}
|
||||
return text;
|
||||
|
||||
Reference in New Issue
Block a user