mirror of
https://github.com/TermoraDev/termora.git
synced 2026-01-16 02:12:58 +08:00
chore: new version dialog (#182)
This commit is contained in:
@@ -4,6 +4,7 @@ import app.termora.Application.ohMyJson
|
|||||||
import kotlinx.serialization.json.*
|
import kotlinx.serialization.json.*
|
||||||
import okhttp3.Request
|
import okhttp3.Request
|
||||||
import org.apache.commons.lang3.StringUtils
|
import org.apache.commons.lang3.StringUtils
|
||||||
|
import org.apache.commons.lang3.time.DateFormatUtils
|
||||||
import org.commonmark.node.BulletList
|
import org.commonmark.node.BulletList
|
||||||
import org.commonmark.node.Heading
|
import org.commonmark.node.Heading
|
||||||
import org.commonmark.node.Paragraph
|
import org.commonmark.node.Paragraph
|
||||||
@@ -97,7 +98,14 @@ class UpdaterManager private constructor() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val parser = Parser.builder().build()
|
val parser = Parser.builder().build()
|
||||||
val document = parser.parse("# ${name.trim()}\n${body.trim()}")
|
val document = parser.parse(
|
||||||
|
"# 🎉 ${name.trim()} (${
|
||||||
|
DateFormatUtils.format(
|
||||||
|
publishedDate,
|
||||||
|
"yyyy-MM-dd"
|
||||||
|
)
|
||||||
|
}) \n${body.trim()}"
|
||||||
|
)
|
||||||
val renderer = HtmlRenderer.builder()
|
val renderer = HtmlRenderer.builder()
|
||||||
.attributeProviderFactory {
|
.attributeProviderFactory {
|
||||||
AttributeProvider { node, _, attributes ->
|
AttributeProvider { node, _, attributes ->
|
||||||
@@ -106,7 +114,7 @@ class UpdaterManager private constructor() {
|
|||||||
attributes["style"] = "margin: 5px 0;"
|
attributes["style"] = "margin: 5px 0;"
|
||||||
} else if (node is BulletList) {
|
} else if (node is BulletList) {
|
||||||
attributes["style"] = "margin: 0 20px;"
|
attributes["style"] = "margin: 0 20px;"
|
||||||
}else if(node is Paragraph){
|
} else if (node is Paragraph) {
|
||||||
attributes["style"] = "margin: 0;"
|
attributes["style"] = "margin: 0;"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user