File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 5454 ////////////////////////////////////////////////////////////////////////////////
5555 // Loading
5656
57+ const utf8ToUTF16 = x => decodeURIComponent ( escape ( x ) ) ;
58+ const utf16ToUTF8 = x => unescape ( encodeURIComponent ( x ) ) ;
59+
5760 const promptText = document . getElementById ( 'promptText' ) ;
5861 const errorText = document . getElementById ( 'errorText' ) ;
5962 const toolbar = document . getElementById ( 'toolbar' ) ;
102105 // Check for a non-empty data URL payload
103106 if ( match && match [ 2 ] ) {
104107 const parts = match [ 1 ] . split ( ';' ) ;
105- const map = parts . indexOf ( 'base64' ) >= 0 ? atob ( match [ 2 ] ) : decodeURIComponent ( match [ 2 ] ) ;
108+ const map = parts . indexOf ( 'base64' ) >= 0 ? utf8ToUTF16 ( atob ( match [ 2 ] ) ) : decodeURIComponent ( match [ 2 ] ) ;
106109 finishLoading ( code , map ) ;
107110 }
108111
15431546 ////////////////////////////////////////////////////////////////////////////////
15441547 // Shareable URLs
15451548
1546- const utf8ToUTF16 = x => decodeURIComponent ( escape ( x ) ) ;
1547- const utf16ToUTF8 = x => unescape ( encodeURIComponent ( x ) ) ;
1548-
15491549 function loadFromHash ( ) {
15501550 try {
15511551 // Reads a string in length-prefix form separated by a null character. This
You can’t perform that action at this time.
0 commit comments