diff --git a/finnow-api/source/util/csv.d b/finnow-api/source/util/csv.d index 385d613..24adb31 100644 --- a/finnow-api/source/util/csv.d +++ b/finnow-api/source/util/csv.d @@ -30,7 +30,9 @@ struct CsvStreamWriter(S) if (isByteOutputStream!S) { import std.regex : replaceAll, regex; import std.string : indexOf; string s = value.to!string(); - bool shouldValueBeQuoted = indexOf(s, '"') != -1 || indexOf(s, ',') != -1; + bool shouldValueBeQuoted = indexOf(s, '"') != -1 || + indexOf(s, ',') != -1 || + indexOf(s, '\n') != -1; s = replaceAll(value.to!string(), regex("\""), "\"\""); if (shouldValueBeQuoted) { s = "\"" ~ s ~ "\"";