From 867aa019ba6748f655d4af4ca2a30d323ae5afd0 Mon Sep 17 00:00:00 2001 From: Evan Wallace Date: Fri, 26 Feb 2021 02:48:44 -0800 Subject: [PATCH] fix #8: "charset=utf-8" can also apply to base64 data --- code.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code.js b/code.js index 4ab1fa5..e34f37d 100644 --- a/code.js +++ b/code.js @@ -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); }