fix: normalize inline numbered lists in CSV export
Converts "1) Item. 2) Item." patterns to line-separated items within quoted CSV cells, matching the frontend normalizeToMarkdown behavior. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -217,7 +217,10 @@ class CSVExportService {
|
||||
if (!value) return '';
|
||||
|
||||
// Normalize line endings but preserve newlines for readability in spreadsheet cells
|
||||
const cleanValue = value.replace(/\r\n/g, '\n').replace(/\r/g, '\n').trim();
|
||||
let cleanValue = value.replace(/\r\n/g, '\n').replace(/\r/g, '\n').trim();
|
||||
|
||||
// Convert inline numbered lists "1) ... 2) ..." to line-separated items for readable cells
|
||||
cleanValue = cleanValue.replace(/\.\s+(\d+)\)\s/g, '.\n$1) ');
|
||||
|
||||
// If value contains comma, quote, or newline, wrap in quotes and escape internal quotes
|
||||
// Excel/Google Sheets render newlines within quoted cells correctly
|
||||
|
||||
Reference in New Issue
Block a user