fix(frontend): wrap values with special characters in double quotes when downloading a CSV (#3232)
* wrapped values with special characters in double quotes when downloading CSV * Update AutoDataTable.svelte --------- Co-authored-by: Ruben Fiszel <ruben@rubenfiszel.com>
This commit is contained in:
@@ -161,7 +161,9 @@
|
||||
return true
|
||||
}
|
||||
})
|
||||
.map(({ rowData }) => Object.values(rowData).join(','))
|
||||
.map(({ rowData }) => Object.values(rowData)
|
||||
.map((field) => /[\",\n]/.test(field) ? "\"" + field.replace(/"/g, "\"\"") + "\"" : row)
|
||||
.join(','))
|
||||
].join('\n')
|
||||
|
||||
const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' })
|
||||
|
||||
Reference in New Issue
Block a user