Skip to content

Commit

Permalink
fix: Fix produced text address list string according to rfc 2822 (#340)
Browse files Browse the repository at this point in the history
  • Loading branch information
neemah authored Jan 4, 2024
1 parent a2ba9c2 commit 6bae600
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/mail-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@ class MailParser extends Transform {
.map(address => {
let str = '';
if (address.name) {
str += address.name + (address.group ? ': ' : '');
str += `"${address.name}"` + (address.group ? ': ' : '');
}
if (address.address) {
let link = address.address;
Expand Down
2 changes: 1 addition & 1 deletion test/simple-parser-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports['Parse message'] = test => {
}
],
html: '<span class="mp_address_group"><span class="mp_address_name">Andris Reinman</span> &lt;<a href="mailto:[email protected]" class="mp_address_email">[email protected]</a>&gt;</span>, <span class="mp_address_group"><a href="mailto:[email protected]" class="mp_address_email">[email protected]</a></span>',
text: 'Andris Reinman <[email protected]>, [email protected]'
text: '"Andris Reinman" <[email protected]>, [email protected]'
});
test.done();
});
Expand Down

0 comments on commit 6bae600

Please sign in to comment.