mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-22 20:18:36 +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 {
|
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
|
@SignalPreview
|
||||||
|
|||||||
Reference in New Issue
Block a user