Skip to content

Commit be89fed

Browse files
committed
more encodeuricomponent
1 parent 4d765e2 commit be89fed

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

index.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070

7171
// Read hash
7272
if(location.hash){
73-
code.value=decodeURI(location.hash.slice(1));
73+
code.value=decodeURIComponent(location.hash.slice(1));
7474
location.hash="";
7575
}
7676

@@ -82,17 +82,17 @@
8282
iframe.srcdoc=custom_console+editor.getValue();
8383

8484
// Update download link
85-
download.href="data:text/html,"+encodeURI(editor.getValue());
85+
download.href="data:text/html,"+encodeURIComponent(editor.getValue());
8686

87-
// Update cpunt
87+
// Update count
8888
document.title=input.length+" chars - Codegolf IDE";
8989

9090
// After typing code, clear console and update iframe and export link
9191
editor.on("keyup",function(){
9292
console.clear();
9393
input=editor.getValue();
94-
iframe.srcdoc=custom_console+input;
95-
download.href="data:text/html,"+encodeURI(input);
94+
iframe.srcdoc=custom_console+editor.getValue();
95+
download.href="data:text/html,"+encodeURIComponent(input);
9696
document.title=input.length+" chars - Codegolf IDE";
9797
});
9898

@@ -106,14 +106,14 @@
106106
console.clear();
107107
editor.setValue(localStorage["code"]);
108108
input=editor.getValue();
109-
iframe.srcdoc=custom_console+input;
110-
download.href="data:text/html,"+encodeURI(input);
109+
iframe.srcdoc=custom_console+editor.getValue();
110+
download.href="data:text/html,"+encodeURIComponent(input);
111111
document.title=input.length+" chars - Codegolf IDE";
112112
}
113113

114114
// Share
115115
share.onclick=function(){
116-
myconsole.innerHTML="http://codegolf.github.io/codegolfIDE/#"+encodeURI(editor.getValue());
116+
myconsole.innerHTML="http://codegolf.github.io/codegolfIDE/#"+encodeURIComponent(editor.getValue());
117117
}
118118

119119
// Minify

0 commit comments

Comments
 (0)