generated from rnentjes/kotlin-server-web-empty
Extend parser to support #. as an ordered list identifier, add alternative list type tests, and update version to 1.0.9.
This commit is contained in:
@@ -40,7 +40,11 @@ fun markdown(text: String): List<MarkdownPart> {
|
||||
if (line.isBlank()) {
|
||||
parseBuffer()
|
||||
continue
|
||||
} else if (line.startsWith("${listIndex++}.") || line.startsWith("-.")) {
|
||||
} else if (
|
||||
line.startsWith("${listIndex++}.")
|
||||
|| line.startsWith("-.")
|
||||
|| line.startsWith("#.")
|
||||
) {
|
||||
buffer.append("\n")
|
||||
buffer.append(line.substring(2))
|
||||
} else {
|
||||
@@ -124,7 +128,7 @@ fun markdown(text: String): List<MarkdownPart> {
|
||||
continue
|
||||
}
|
||||
|
||||
line.startsWith("1.") || line.startsWith("-.") -> {
|
||||
line.startsWith("1.") || line.startsWith("-.") || line.startsWith("#.") -> {
|
||||
parseBuffer()
|
||||
type = MarkdownType.ORDERED_LIST
|
||||
listIndex = 2
|
||||
|
||||
Reference in New Issue
Block a user