Skip to content

Commit

Permalink
Merge pull request #679 from nkdengineer/fix/38877-LHN-preview-show-a…
Browse files Browse the repository at this point in the history
…ttachment

fix LHN preview shows incorrect message with attachment
  • Loading branch information
marcochavezf authored Apr 12, 2024
2 parents c2df007 + 087665b commit 0b1275e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion __tests__/ExpensiMark-HTMLToText-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,5 +149,5 @@ test('Mention html to text', () => {

test('Test replacement for <img> tags', () => {
const testString = '<img src="https://example.com/image.png" alt="Image description" />';
expect(parser.htmlToText(testString)).toBe('(image of: Image description)');
expect(parser.htmlToText(testString)).toBe('[Attachment]');
});
2 changes: 1 addition & 1 deletion lib/ExpensiMark.js
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ export default class ExpensiMark {
{
name: 'image',
regex: /<img[^><]*src\s*=\s*(['"])(.*?)\1(?:[^><]*alt\s*=\s*(['"])(.*?)\3)?[^><]*>*(?![^<][\s\S]*?(<\/pre>|<\/code>))/gi,
replacement: '(image of: $4)',
replacement: '[Attachment]',
},
{
name: 'stripTag',
Expand Down

0 comments on commit 0b1275e

Please sign in to comment.