-
Notifications
You must be signed in to change notification settings - Fork 71
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
Cannot parse URLs that contain @
#13
Comments
Should I simply remove everything after the initial slash & parse that? |
@JakeSidSmith did that work for you? I think I might be running into the same issue. |
@sfnewzgirl I ended up using I pass var urlInfo = parseUrl('/', 'https://medium.com/@username/'); This gives me the following: {
slashes: true,
protocol: 'http:',
hash: '',
query: '',
pathname: '/',
auth: '',
host: 'medium.com',
port: '',
hostname: 'medium.com',
password: '',
username: '',
origin: 'http://medium.com',
href: 'http://medium.com/'
} And then I parse the href into domainParse var domain = parseDomain(urlInfo.href); Which gives me the expected: {
tld: 'com',
domain: 'medium',
subdomain: ''
} This may be a little heavyweight for your project if you don't need any more URL info though. You could quite easily manually split after the domain name and then call |
Thx for reporting this. A fix shipped with |
I've been using your lib quite successfully until I came across a link with an
@
in it.More specifically, this is a users profile on
https://medium.com/
. These are formatted like:https://medium.com/@username/
.Is this something you could fix easily, or is this intended (I assume it's something to do with emails)?
The text was updated successfully, but these errors were encountered: