Skip to content

Commit 9e127e0

Browse files
committed
Fix new line issue with input
1 parent 7a1c0a3 commit 9e127e0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

assets/js/code-editor.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ var current_inp = 0;
1515
function get_input(prompt) {
1616
return new Promise((resolve, reject) => {
1717
let input = document.getElementById('input-tmp').value.split(/\r?\n/);
18+
if (input[0] == '') {
19+
input = [];
20+
}
21+
console.log(input, current_inp)
1822
if (current_inp >= input.length) {
1923
throw "Place your input(s) in the \"input\" box!";
2024
}

0 commit comments

Comments
 (0)