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

Do not try to import data: tel: mailto: something: URLs #50

Merged
merged 4 commits into from Dec 6, 2017
Merged

Do not try to import data: tel: mailto: something: URLs #50

merged 4 commits into from Dec 6, 2017

Conversation

oliger
Copy link
Contributor

@oliger oliger commented Dec 6, 2017

Parcel is trying to "import" data URLs. This PR ignore URLs when they start with data:.

@oliger
Copy link
Contributor Author

oliger commented Dec 6, 2017

So it seems that this PR fixes #43... And that it was already taken by @ssuman... Feel free to close.

@oliger oliger changed the title Ignore data URLs Do not try to import data: tel: mailto: something: URLs Dec 6, 2017
@oliger
Copy link
Contributor Author

oliger commented Dec 6, 2017

Found out that Parcel needs to ignore all something: URLs. I made one more commit to accept URLs that start with mailto:, tel:.

@@ -1,5 +1,5 @@
const isURL = require('is-url');

module.exports = function (url) {
return isURL(url) || /^#/.test(url);
return isURL(url) || /^#/.test(url) || /^[a-z]*\:/i.test(url);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we hoist these regexes into constants and add descriptions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oliger
Copy link
Contributor Author

oliger commented Dec 6, 2017 via email

@devongovett devongovett merged commit 781b7ec into parcel-bundler:master Dec 6, 2017
@devongovett
Copy link
Member

Thanks!

@oliger oliger deleted the data-url branch December 7, 2017 16:45
devongovett pushed a commit that referenced this pull request Oct 15, 2018
* Ignore data URLs

* Add tests

* Ignore tel and mailto URLs

* Hoist  regexes into constants
devongovett pushed a commit that referenced this pull request Oct 15, 2018
* Ignore data URLs

* Add tests

* Ignore tel and mailto URLs

* Hoist  regexes into constants
padmaia pushed a commit that referenced this pull request Jun 5, 2020
add aliasField option to NodeResolver

Approved-by: Maia Teegarden
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 this pull request may close these issues.

None yet

3 participants