recognize when //# sourceMappingURL is percent-encoded #1330
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TypeScript 4.1.1 started percent-encoding the filenames in
//# sourceMappingURL
Before TS 4.1.1:
After TS 4.1.1
Changes made to support
--transpiler
(#1160) effectively avoided this issue. We computed where we thought the comment should begin, but if it wasn't at that position, we simply appended oursourceMappingURL
comment, overriding whatever was already there. This means if a path was percent-encoded, we didn't care: we appended, overrode, and users were happy.Nevertheless, this PR implements logic to percent-encode the path and check for a sourceMappingURL comment at that offset.
The new logic is:
sourceMappingURL
comment after any comment that might already be thereSee also: #1322