Skip to content

Commit b351227

Browse files
Fixed csv parsing to escape \n
1 parent 12e7856 commit b351227

File tree

1 file changed

+3
-1
lines changed
  • packages/dev/core/lib/api/bitbybit

1 file changed

+3
-1
lines changed

packages/dev/core/lib/api/bitbybit/csv.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ export class CSVBitByBit {
1818
// Convert literal escape sequences to actual characters
1919
const rowSeparator = this.convertEscapeSequences(inputs.rowSeparator || "\n");
2020
const columnSeparator = this.convertEscapeSequences(inputs.columnSeparator || ",");
21-
const lines = inputs.csv.split(rowSeparator);
21+
// Also convert escape sequences in the CSV data itself (e.g., literal "\n" to actual newline)
22+
const csvData = this.convertEscapeSequences(inputs.csv);
23+
const lines = csvData.split(rowSeparator);
2224
const result: string[][] = [];
2325

2426
for (let i = 0; i < lines.length; i++) {

0 commit comments

Comments
 (0)