fix excel version

This commit is contained in:
dalia.florinda
2026-01-22 11:43:49 +01:00
parent c6e29d158a
commit 6a26794c86

View File

@@ -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