mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-23 04:28:35 +00:00
Properly escape CSV output in playground.
This commit is contained in:
@@ -200,7 +200,15 @@ private fun QueryResult.toCopyString(): String {
|
||||
}
|
||||
|
||||
private fun List<Any?>.toCsv(): String {
|
||||
return this.joinToString(separator = ", ", transform = { it.toDisplayString() })
|
||||
return this.joinToString(
|
||||
separator = ",",
|
||||
transform = { input ->
|
||||
input
|
||||
.toDisplayString()
|
||||
.replace("\"", "\"\"")
|
||||
.let { if (it.isNotEmpty()) "\"$it\"" else "" }
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@SignalPreview
|
||||
|
||||
Reference in New Issue
Block a user