From 61782d27dc32e88c74e1fde2274c644e47bdf91e Mon Sep 17 00:00:00 2001 From: Jaeho Shin Date: Fri, 13 Jun 2014 23:20:16 -0700 Subject: [PATCH] Also find sourceMappingURL= comments in the middle not just at the last line of the code. Strictly speaking, sourceMappingURL= comments have to appear at the end of the file as the last line. However, for this module to be more useful, I relaxed the regex a bit. Ideally, we could provide an option to users whether it should strictly stay with the specification, or pragmatically look at the entire code for the comments. --- source-map-url.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source-map-url.js b/source-map-url.js index 88c4709..20bce1b 100644 --- a/source-map-url.js +++ b/source-map-url.js @@ -25,7 +25,7 @@ void (function(root, factory) { "|" + "//(?:" + innerRegex.source + ")" + ")" + - "\\s*$" + "\\s*(?:$|(?:" + newlineRegex.source + "))" ) function SourceMappingURL(commentSyntax) {