-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
Avoid matching sourceMappingURL inside a template string #61
Conversation
Patch added. All tests passing. LGTM This also removes the example comment, since this library may sometimes parse itself, resulting in false positives. |
index.js
Outdated
//Example (Extra space between slashes added to solve Safari bug. Exclude space in production): | ||
// / /# sourceMappingURL=foo.js.map /*# sourceMappingURL=foo.js.map */ | ||
return /(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^\*]+?)[ \t]*(?:\*\/){1}[ \t]*$)/mg; | ||
return /(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"`]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^\*]+?)[ \t]*(?:\*\/){1}[ \t]*$)/mg; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we please keep the comments that were there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about something more like:
// Matches sourceMappingURL in either // or /* comment styles.
The current comment interferes with global packages where two installations of convert-source-map
end up parsing each other, causing an error to be thrown.
LGTM after the nit is fixed. Would like at least one more collab to have a look before merging. |
b400a9b
to
38ca213
Compare
@aleclarson made you collaborator. Please merge to master following this guide. Thanks. |
@thlorenz Done 👍 |
Thanks published as patch |
Proof for issue #60