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

Literal spaces after path are valid URLs #7

Closed
brandon93s opened this issue Nov 25, 2020 · 3 comments · Fixed by #8
Closed

Literal spaces after path are valid URLs #7

brandon93s opened this issue Nov 25, 2020 · 3 comments · Fixed by #8

Comments

@brandon93s
Copy link
Contributor

Documenting an edge case for future users: if a sentence starts with a URL and contains a path, any literal spaces are considered valid and the full sentence will be considered a valid URL. This is technically a valid URL which your browser will encode for you upon navigation. The URL implementation allows for it as unencoded input.

const isUrl = require('is-url-superb')
isUrl('https://github.com/sindresorhus/is-url-superb is the repo for an npm package to validate URLs.')
// => true
@sindresorhus
Copy link
Owner

Maybe we should do a check here for whether there are any unescaped spaces and if so return false?

@brandon93s
Copy link
Contributor Author

I support that as I believe it to be a more intuitive behavior even if it's a deviation from the URL implementation. Glad to open a quick PR.

@brandon93s brandon93s reopened this Nov 28, 2020
@sindresorhus
Copy link
Owner

PR welcome

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

Successfully merging a pull request may close this issue.

2 participants