From 2ac788bf48d613407d8e5e620cef7b2f50661c20 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 2 Jan 2013 15:02:08 +0530 Subject: [PATCH] escape string while exporting to csv --- public/js/wn/misc/tools.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/js/wn/misc/tools.js b/public/js/wn/misc/tools.js index 2ecbeee6ef..167fda534c 100644 --- a/public/js/wn/misc/tools.js +++ b/public/js/wn/misc/tools.js @@ -34,7 +34,7 @@ wn.to_csv = function(data) { var res = []; $.each(data, function(i, row) { row = $.map(row, function(col) { - return typeof(col)==="string" ? ('"' + col.replace(/"/g, '\"') + '"') : col; + return typeof(col)==="string" ? ('"' + col.replace(/"/g, '""') + '"') : col; }); res.push(row.join(",")); });