Rich-Harris / sorcery

Resolve a chain of sourcemaps back to the original source, like magic

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Extract sourceMappingURL from escaped string

kmdavis opened this issue · comments

Not sure how it happened, but getSourceMappingUrl is operating on an escaped string, so, the newline character is actually \\n instead of \n. I was able to fix locally by adding \\ to the regex on this line:

match = /^[^\r\n\\]+/.exec( substring );

but a better fix would be to unescape this string before matching