Skip to content

Commit

Permalink
fix sokra#8: "charset=utf-8" can also apply to base64 data
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed Feb 26, 2021
1 parent 3cf8dfe commit 867aa01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
// Check for a non-empty data URL payload
if (match && match[2]) {
const parts = match[1].split(';');
const map = parts.indexOf('charset=utf-8') >= 0 ? decodeURIComponent(match[2]) : atob(match[2]);
const map = parts.indexOf('base64') >= 0 ? atob(match[2]) : decodeURIComponent(match[2]);
finishLoading(code, map);
}

Expand Down

0 comments on commit 867aa01

Please sign in to comment.