Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text between square brackets generates a "No Results" error #59

Closed
JeremyPouyet opened this issue Nov 23, 2021 · 1 comment
Closed

Text between square brackets generates a "No Results" error #59

JeremyPouyet opened this issue Nov 23, 2021 · 1 comment

Comments

@JeremyPouyet
Copy link

Some addresses I met contain text between brackets and this module generates an error. A simple example:

> const addrparser = require('address-rfc2822');
> const addresses = addrparser.parse("Matt Sergeant [hello] <[email protected]>");
Uncaught Error: No results
    at Object.parse (/home/project/node_modules/address-rfc2822/index.js:32:22)

In section 3.2.1 of the RFC2822, these brackets are described with No special semantics are attached to these tokens. They are simply single characters.
I don't know how the text between brackets should be handled but an error seems inappropriate.

@msimerson
Copy link
Member

This library name wasn't future-proof, and as the README says, it is now compatible with RFC 5322. Our implementation is now based on email-addresses and there's an open issue there regarding brackets. The gist is, they're only allowed when the display name is quoted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants