diff --git a/__tests__/ExpensiMark-test.js b/__tests__/ExpensiMark-test.js index 2755c3e2..cad53935 100644 --- a/__tests__/ExpensiMark-test.js +++ b/__tests__/ExpensiMark-test.js @@ -38,3 +38,9 @@ test('Test extract link with ending parentheses', () => { const links = ['https://staging.new.expensify.com/details', 'https://staging.new.expensify.com/details', 'https://staging.new.expensify.com/details']; expect(parser.extractLinksInMarkdownComment(comment)).toStrictEqual(links); }); + +test('Test extract link from Markdown link syntax', () => { + const comment = 'www.google.com https://www.google.com [Expensify](https://new.expensify.com/)'; + const links = ['https://new.expensify.com/']; + expect(parser.extractLinksInMarkdownComment(comment)).toStrictEqual(links); +}); diff --git a/lib/ExpensiMark.js b/lib/ExpensiMark.js index 755859ae..33360bc6 100644 --- a/lib/ExpensiMark.js +++ b/lib/ExpensiMark.js @@ -771,7 +771,7 @@ export default class ExpensiMark { */ extractLinksInMarkdownComment(comment) { try { - const htmlString = this.replace(comment); + const htmlString = this.replace(comment, {filterRules: ['link']}); // We use same anchor tag template as link and autolink rules to extract link const regex = new RegExp(``, 'gi');