diff --git a/src/CONST.ts b/src/CONST.ts index 19720c05a93c..d81eec4108bd 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -1943,7 +1943,7 @@ const CONST = { POLICY_ID_FROM_PATH: /\/w\/([a-zA-Z0-9]+)(\/|$)/, - SHORT_MENTION: new RegExp(`@[\\w\\-\\+\\'#@]+(?:\\.[\\w\\-\\'\\+]+)*`, 'gim'), + SHORT_MENTION: new RegExp(`@[\\w\\-\\+\\'#@]+(?:\\.[\\w\\-\\'\\+]+)*(?![^\`]*\`)`, 'gim'), }, PRONOUNS: { diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 641d3ddaa268..291ef89e92f0 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -3352,6 +3352,9 @@ function getParsedComment(text: string, parsingDetails?: ParsingDetails): string const parser = new ExpensiMark(); const textWithMention = text.replace(CONST.REGEX.SHORT_MENTION, (match) => { + if (!Str.isValidMention(match)) { + return match; + } const mention = match.substring(1); const mentionWithDomain = addDomainToShortMention(mention); return mentionWithDomain ? `@${mentionWithDomain}` : match;