From 53dd849096631505a097ae7c4c93492b63941098 Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 25 Feb 2026 12:10:28 -0500 Subject: [PATCH] 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 --- backend/src/services/csvExportService.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/src/services/csvExportService.ts b/backend/src/services/csvExportService.ts index bf380df..9edddb1 100644 --- a/backend/src/services/csvExportService.ts +++ b/backend/src/services/csvExportService.ts @@ -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