Fix checkbox list parsing error, and update version to 1.0.5

This commit is contained in:
2026-01-07 19:40:32 +01:00
parent 160622b262
commit 11a6f3a57b
3 changed files with 20 additions and 6 deletions

View File

@@ -182,7 +182,11 @@ fun markdown(text: String): List<MarkdownPart> {
index++
}
parseBuffer()
if (type == MarkdownType.CHECKBOX_LIST) {
parts.add(MarkdownPart.CheckboxList(checkboxList))
} else {
parseBuffer()
}
return parts
}

View File

@@ -66,6 +66,19 @@ class ParseTest {
printMarkdownParts(md)
}
@Test
fun testCheckboxListError() {
val input = """
Dit is een text
- [ ] Not checked
- [x] Checked""".trimIndent()
val md = markdown(input)
printMarkdownParts(md)
}
@Test
fun testHeading() {
val input = "# Markdown\n\nMy **markdown** text."