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

Fixed sourcemap url detection from code. #58

Merged
merged 1 commit into from
May 15, 2015

Conversation

marcominetti
Copy link
Collaborator

Brutally fixes #57 ... Assuming there is never ' or " within the uri...

@marcominetti
Copy link
Collaborator Author

@julien-f quick review before merge?

@julien-f
Copy link
Collaborator

I do not think the URL may be surrounded by quotes nor prefixed by spaces.

Appart from that I think it's fair to assume that an URL should not contain any quote because the source map spec say:

<url> is a URL as defined in RFC3986; in particular, characters outside the set permitted to appear in URIs must be percent-encoded.

@marcominetti
Copy link
Collaborator Author

I agree...

@marcominetti
Copy link
Collaborator Author

I've included the surrounded quotes match, just in case the specs or any custom implementation change...

@julien-f
Copy link
Collaborator

I think, for now, it should be enough to just change (.*) to ([^'"]+).

Would that be enough to fix your problem?

@marcominetti
Copy link
Collaborator Author

Yep, I change the code and squash commits...

marcominetti pushed a commit that referenced this pull request May 15, 2015
Fixed sourcemap url detection.
@marcominetti marcominetti merged commit d85089b into evanw:master May 15, 2015
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.

Misleading sourceMappingURL detection within source
2 participants