Skip to content

Commit 4d827ae

Browse files
committed
fix: roundtrip markdown & SortOptionTest count
Fix toMarkdown() missing newline between title header and content/checklist, which caused fromMarkdown() to merge title + first content line on roundtrip. Fix SortOptionTest: update expected count from 5 to 7 to reflect CREATION_DATE and CREATION_DATE_DESC added in v1.11.0.
1 parent f6db107 commit 4d827ae

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

β€Žandroid/app/src/main/java/dev/dettmer/simplenotes/models/Note.ktβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,13 @@ type: ${noteType.name.lowercase()}$sortLine
111111
""".trimIndent()
112112

113113
return when (noteType) {
114-
NoteType.TEXT -> header + content
114+
NoteType.TEXT -> header + "\n" + content
115115
NoteType.CHECKLIST -> {
116116
val checklistMarkdown = checklistItems?.sortedBy { it.order }?.joinToString("\n") { item ->
117117
val checkbox = if (item.isChecked) "[x]" else "[ ]"
118118
"- $checkbox ${item.text}"
119119
}.orEmpty()
120-
header + checklistMarkdown
120+
header + "\n" + checklistMarkdown
121121
}
122122
}
123123
}

β€Žandroid/app/src/test/java/dev/dettmer/simplenotes/models/SortOptionTest.ktβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ class SortOptionTest {
7777
// ═══════════════════════════════════════════════
7878

7979
@Test
80-
fun `ChecklistSortOption has all 5 values`() {
81-
assertEquals(5, ChecklistSortOption.entries.size)
80+
fun `ChecklistSortOption has all 7 values`() {
81+
assertEquals(7, ChecklistSortOption.entries.size)
8282
}
8383

8484
@Test

0 commit comments

Comments
Β (0)