Merged PR 250: fix excel version

fix excel version
This commit is contained in:
D'Alia, Florinda
2026-01-22 13:56:11 +00:00

View File

@@ -647,13 +647,13 @@ export default {
const cells = row.querySelectorAll('th, td');
const rowData = Array.from(cells).map((cell) => {
let text = cell.textContent.trim();
// Escape quotes and wrap in quotes if contains comma
if (text.includes(',') || text.includes('"') || text.includes('\n')) {
// Escape quotes and wrap in quotes if contains semicolon, quotes or newlines
if (text.includes(';') || text.includes('"') || text.includes('\n')) {
text = '"' + text.replace(/"/g, '""') + '"';
}
return text;
});
csv += rowData.join(',') + '\n';
csv += rowData.join(';') + '\n';
});
// Add UTF-8 BOM for proper character encoding