diff --git a/src/components/RichContenteditable/RichContenteditable.vue b/src/components/RichContenteditable/RichContenteditable.vue index c08204e6b6..60af60a3e4 100644 --- a/src/components/RichContenteditable/RichContenteditable.vue +++ b/src/components/RichContenteditable/RichContenteditable.vue @@ -80,6 +80,19 @@ export default { status: 'away', }, subline: 'Visiting London', + }, + 'Test 03': { + icon: 'icon-user', + id: 'Test 03', + label: 'Test 03', + source: 'users', + status: { + clearAt: null, + icon: '🎡', + message: 'Having space in my name', + status: 'in space', + }, + subline: 'Visiting London', } } } diff --git a/src/mixins/richEditor/index.js b/src/mixins/richEditor/index.js index cee5917e28..bceaca4544 100644 --- a/src/mixins/richEditor/index.js +++ b/src/mixins/richEditor/index.js @@ -32,7 +32,7 @@ const MENTION_START = '(?:^|\\s)' // Anything that is not text or end-of-line. Non-capturing group const MENTION_END = '(?:[^a-z]|$)' export const USERID_REGEX = new RegExp(`${MENTION_START}(@[a-zA-Z0-9_.@\\-']+)(${MENTION_END})`, 'gi') -export const USERID_REGEX_WITH_SPACE = new RegExp(`${MENTION_START}(@"[a-zA-Z0-9 _.@\\-']+")(${MENTION_END})`, 'gi') +export const USERID_REGEX_WITH_SPACE = new RegExp(`${MENTION_START}(@"[a-zA-Z0-9 _.@\\-']+")(${MENTION_END})`, 'gi') export default { props: { @@ -74,8 +74,7 @@ export default { } // Extracting the id, nuking the " and @ - const id = part.replace(/[@"]/gi, '') - + const id = part.replace(/@|"/gi, '') // Compiling template and prepend with the space we removed during the split return ' ' + this.genSelectTemplate(id) })