Skip to content

Commit 8e18694

Browse files
committed
fix minor bug & enable autosave by default
1 parent e76ee91 commit 8e18694

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

script.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function save() {
3636
headers: {
3737
'Content-type': 'application/json'
3838
},
39-
body: lines.join('\n').replace(/\xA0/g,' ').replace(/\s+/g, ' ')
39+
body: lines.map(line => line.replace(/\xA0/g,' ').replace(/\s+/g, ' ')).join('\n')
4040
}).then(res => res.ok ? Promise.resolve() : Promise.reject(res));
4141
}
4242

@@ -47,7 +47,7 @@ function autoSave() {
4747
.catch(r => console.log(r));
4848
}
4949

50-
load(); //.then(autoSave);
50+
load().then(autoSave);
5151

5252
function appendNewSpan() {
5353
let i = document.getElementsByTagName("span").length;

0 commit comments

Comments
 (0)