Skip to content

Commit ae86d77

Browse files
committed
Downloaded csv files no longer quote every cell.
1 parent 02e64f8 commit ae86d77

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

js/index.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,17 @@ function downloadTable(table){
256256

257257
for(var i = 0; i < ta.length; i++){
258258
for(var j = 0; j < ta[i].length; j++){
259-
if(j === ta[i].length - 1)
260-
csvArray.push("\"" + ta[i][j] + "\"");
261-
else
262-
csvArray.push("\"" + ta[i][j] + "\"" + separator);
259+
if(ta[i][j].includes(getUserInput().columnSeparator)){
260+
if(j === ta[i].length - 1)
261+
csvArray.push("\"" + ta[i][j] + "\"");
262+
else
263+
csvArray.push("\"" + ta[i][j] + "\"" + separator);
264+
} else {
265+
if(j === ta[i].length - 1)
266+
csvArray.push(ta[i][j]);
267+
else
268+
csvArray.push(ta[i][j] + separator);
269+
}
263270
}
264271
csvArray.push("\n");
265272
}

0 commit comments

Comments
 (0)