Merged PR 250: fix excel version
fix excel version
This commit is contained in:
@@ -647,13 +647,13 @@ export default {
|
|||||||
const cells = row.querySelectorAll('th, td');
|
const cells = row.querySelectorAll('th, td');
|
||||||
const rowData = Array.from(cells).map((cell) => {
|
const rowData = Array.from(cells).map((cell) => {
|
||||||
let text = cell.textContent.trim();
|
let text = cell.textContent.trim();
|
||||||
// Escape quotes and wrap in quotes if contains comma
|
// Escape quotes and wrap in quotes if contains semicolon, quotes or newlines
|
||||||
if (text.includes(',') || text.includes('"') || text.includes('\n')) {
|
if (text.includes(';') || text.includes('"') || text.includes('\n')) {
|
||||||
text = '"' + text.replace(/"/g, '""') + '"';
|
text = '"' + text.replace(/"/g, '""') + '"';
|
||||||
}
|
}
|
||||||
return text;
|
return text;
|
||||||
});
|
});
|
||||||
csv += rowData.join(',') + '\n';
|
csv += rowData.join(';') + '\n';
|
||||||
});
|
});
|
||||||
|
|
||||||
// Add UTF-8 BOM for proper character encoding
|
// Add UTF-8 BOM for proper character encoding
|
||||||
|
|||||||
Reference in New Issue
Block a user