diff --git a/__tests__/ExpensiMark-HTML-test.js b/__tests__/ExpensiMark-HTML-test.js index 3c0f3dec..e0c5b893 100644 --- a/__tests__/ExpensiMark-HTML-test.js +++ b/__tests__/ExpensiMark-HTML-test.js @@ -1117,6 +1117,12 @@ test('Test for user mention with @username@domain.com', () => { expect(parser.replace(testString)).toBe(resultString); }); +test('Test for user mention with @@username@domain.com', () => { + const testString = '@@username@expensify.com'; + const resultString = '@@username@expensify.com'; + expect(parser.replace(testString)).toBe(resultString); +}); + test('Test for user mention with @phoneNumber@domain.sms', () => { const testString = '@+19728974297@expensify.sms'; const resultString = '@+19728974297@expensify.sms'; diff --git a/lib/ExpensiMark.js b/lib/ExpensiMark.js index e34bcb7a..a8fa6873 100644 --- a/lib/ExpensiMark.js +++ b/lib/ExpensiMark.js @@ -128,7 +128,7 @@ export default class ExpensiMark { */ { name: 'userMentions', - regex: new RegExp(`(@here|[a-zA-Z0-9.!$%&+=?^\`{|}-]?)(@+${CONST.REG_EXP.EMAIL_PART})(?!((?:(?!|[^<]*(<\\/pre>|<\\/code>))`, 'gim'), + regex: new RegExp(`(@here|[a-zA-Z0-9.!$%&+=?^\`{|}-]?)(@${CONST.REG_EXP.EMAIL_PART})(?!((?:(?!|[^<]*(<\\/pre>|<\\/code>))`, 'gim'), replacement: (match, g1, g2) => { if (!Str.isValidMention(match)) { return match;