expensify-common 2.0.11 → 2.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -213,7 +213,10 @@ class ExpensiMark {
213
213
  return `${g1}<mention-user>${g2}${phoneRegex.test(g2) ? `@${Constants.CONST.SMS.DOMAIN}` : ''}</mention-user>`;
214
214
  },
215
215
  rawInputReplacement: (match, g1, g2) => {
216
- if (!str_1.default.isValidMention(match)) {
216
+ const phoneNumberRegex = new RegExp(`^${Constants.CONST.REG_EXP.PHONE_PART}$`);
217
+ const mention = g2.slice(1);
218
+ const mentionWithoutSMSDomain = str_1.default.removeSMSDomain(mention);
219
+ if (!str_1.default.isValidMention(match) || (phoneNumberRegex.test(mentionWithoutSMSDomain) && !str_1.default.isValidPhoneNumber(mentionWithoutSMSDomain))) {
217
220
  return match;
218
221
  }
219
222
  return `${g1}<mention-user>${g2}</mention-user>`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expensify-common",
3
- "version": "2.0.11",
3
+ "version": "2.0.12",
4
4
  "author": "Expensify, Inc.",
5
5
  "description": "Expensify libraries and components shared across different repos",
6
6
  "homepage": "https://expensify.com",