serialize and escape quotes on nested objects when exporting as csv
This commit is contained in:
parent
d54b6a497c
commit
f2a10600c0
@ -11,8 +11,7 @@
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
|
||||
var name,
|
||||
baseURL = "_rewrite/",
|
||||
var baseURL = "_rewrite/",
|
||||
vhost = false;
|
||||
|
||||
if (document.location.pathname.indexOf("_design") == -1) {
|
||||
@ -32,6 +31,7 @@
|
||||
}
|
||||
|
||||
function gotDb(dbInfo) {
|
||||
|
||||
render('db', 'stats', dbInfo);
|
||||
|
||||
var data = {
|
||||
|
||||
@ -18,7 +18,9 @@ function(head, req) {
|
||||
for (var header in headers) {
|
||||
if (row.value[headers[header]]) {
|
||||
if (startedOutput) send(",");
|
||||
send("\"" + row.value[headers[header]] + "\"");
|
||||
var value = row.value[headers[header]];
|
||||
if (typeof(value) == "object") value = JSON.stringify(value).replace(/"/g, '\\"');
|
||||
send("\"" + value + "\"");
|
||||
} else {
|
||||
if (startedOutput) send(",");
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
},
|
||||
{
|
||||
"to": "_list/csv/all",
|
||||
"from": "*.csv"
|
||||
"from": "csv"
|
||||
},
|
||||
{
|
||||
"to": "_list/urlencode/headers",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user