Merge branch 'develop' of https://github.com/HabitRPG/habitica into negue/flagpm

This commit is contained in:
negue
2019-01-27 18:14:51 +01:00
807 changed files with 41837 additions and 36396 deletions

View File

@@ -325,7 +325,9 @@ export default {
this.$emit('show-member-modal', memberId);
},
atHighlight (text) {
const userRegex = new RegExp(`@(${this.user.auth.local.username}|${this.user.profile.name})(?:\\b)`, 'gi');
const escapedDisplayName = escapeRegExp(this.user.profile.name);
const escapedUsername = escapeRegExp(this.user.auth.local.username);
const userRegex = new RegExp(`@(${escapedDisplayName}|${escapedUsername})(?:\\b)`, 'gi');
const atRegex = new RegExp(/(?!\b)@[\w-]+/g);
if (userRegex.test(text)) {