From 0482f1797817bf2b7e2352a806bd7fdb23d01c8b Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Mon, 8 Apr 2024 17:40:25 +0700 Subject: [PATCH 1/2] fix LHN preview shows incorrect message with attachment --- lib/ExpensiMark.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ExpensiMark.js b/lib/ExpensiMark.js index b70228bb..2d47dd61 100644 --- a/lib/ExpensiMark.js +++ b/lib/ExpensiMark.js @@ -476,7 +476,7 @@ export default class ExpensiMark { { name: 'image', regex: /<]*src\s*=\s*(['"])(.*?)\1(?:[^><]*alt\s*=\s*(['"])(.*?)\3)?[^><]*>*(?![^<][\s\S]*?(<\/pre>|<\/code>))/gi, - replacement: '(image of: $4)', + replacement: '[Attachment]', }, { name: 'stripTag', From 087665bf69cce37ccb091e7b1474cc4456f289e4 Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Wed, 10 Apr 2024 15:35:18 +0700 Subject: [PATCH 2/2] fix test --- __tests__/ExpensiMark-HTMLToText-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__tests__/ExpensiMark-HTMLToText-test.js b/__tests__/ExpensiMark-HTMLToText-test.js index 02bcd523..7a65d877 100644 --- a/__tests__/ExpensiMark-HTMLToText-test.js +++ b/__tests__/ExpensiMark-HTMLToText-test.js @@ -149,5 +149,5 @@ test('Mention html to text', () => { test('Test replacement for tags', () => { const testString = 'Image description'; - expect(parser.htmlToText(testString)).toBe('(image of: Image description)'); + expect(parser.htmlToText(testString)).toBe('[Attachment]'); });