Chat bubbles: preserve single newlines in agent messages too — the hard-break rule from user bubbles now applies to agent replies as well, so status lines and model-wrapped text render one line per field instead of collapsing into a wall of text; unit tests for preserveNewlinesAsHardBreaks
This commit is contained in:
1 parent
1bcadcf950
commit
ec53769325
3 files changed
+34
-8
No files matched your search
@@ -39,4 +39,26 @@ class MarkdownTest {
|
||||
fun allBlankBecomesEmpty() {
|
||||
assertEquals("", "\n\n \n".prepareForMarkdown())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun convertsSingleNewlinesToHardBreaks() {
|
||||
assertEquals("a \nb ", "a\nb".preserveNewlinesAsHardBreaks())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun keepsBlankLinesAsParagraphBreaks() {
|
||||
assertEquals("a \n\nb ", "a\n\nb".preserveNewlinesAsHardBreaks())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun leavesFencedCodeBlocksUntouched() {
|
||||
val md = "```kotlin\nval a = 1\nval b = 2\n```"
|
||||
assertEquals(md, md.preserveNewlinesAsHardBreaks())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun statusStyleLinesBecomeHardBreaks() {
|
||||
val md = "**Title:** x\n**Model:** y"
|
||||
assertEquals("**Title:** x \n**Model:** y ", md.preserveNewlinesAsHardBreaks())
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user