Skip to content

Commit 638a0ef

Browse files
committed
fix(core): md最后多余的换行符
1 parent 72e7470 commit 638a0ef

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

arona/arona-core/build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ kotlin {
1212
freeCompilerArgs.add("-Xcontext-receivers")
1313
}
1414
}
15-
version = "1.3.6"
15+
version = "1.3.7"
1616
application {
1717
mainClass = "com.diyigemt.arona.ApplicationKt"
1818

arona/arona-core/src/main/kotlin/com/diyigemt/arona/communication/message/Markdown.kt

+7-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ data class Markdown(
3333
is InlineCommandElement -> it.build()
3434
else -> it.build() + "\n"
3535
}
36+
}.let {
37+
if (it.lastOrNull() == '\n') {
38+
it.substring(0, it.length - 1)
39+
} else {
40+
it
41+
}
3642
}
3743
}
3844
}
@@ -166,7 +172,7 @@ data class ListElement(
166172
override fun build(): String {
167173
return content.mapIndexed { idx, it ->
168174
"${
169-
if (hasIndex) "$idx." else "-"
175+
if (hasIndex) "${idx + 1}." else "-"
170176
} ${it.build()}"
171177
}.joinToString("\n")
172178
}

0 commit comments

Comments
 (0)