diff --git a/__tests__/ExpensiMark-HTML-test.js b/__tests__/ExpensiMark-HTML-test.js index 919fea9a..66ca728b 100644 --- a/__tests__/ExpensiMark-HTML-test.js +++ b/__tests__/ExpensiMark-HTML-test.js @@ -843,8 +843,8 @@ test('Test markdown style email link with various styles', () => { + 'Expensify Email' + 'concierge@expensify.com' + 'concierge@expensify.com' - + 'mailto:concierge@expensify.com' - + 'mailto:concierge@expensify.com' + + 'concierge@expensify.com' + + 'concierge@expensify.com' + 'concierge-other@expensify.com' + '(Expensify)' + '[Expensify Test Test](concierge@expensify.com)' diff --git a/lib/ExpensiMark.js b/lib/ExpensiMark.js index 877c469e..73b6bcfc 100644 --- a/lib/ExpensiMark.js +++ b/lib/ExpensiMark.js @@ -68,7 +68,12 @@ export default class ExpensiMark { if (g1.match(CONST.REG_EXP.EMOJIS) || !g1.trim()) { return match; } - return `${g1.trim()}`; + let label = g1.trim(); + const href = `mailto:${g2}`; + if (label === href) { + label = g2; + } + return `${label}`; }, },