aboutsummaryrefslogtreecommitdiff
path: root/plugins/gfm/src/main/kotlin
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/gfm/src/main/kotlin')
-rw-r--r--plugins/gfm/src/main/kotlin/org/jetbrains/dokka/gfm/renderer/CommonmarkRenderer.kt16
1 files changed, 16 insertions, 0 deletions
diff --git a/plugins/gfm/src/main/kotlin/org/jetbrains/dokka/gfm/renderer/CommonmarkRenderer.kt b/plugins/gfm/src/main/kotlin/org/jetbrains/dokka/gfm/renderer/CommonmarkRenderer.kt
index 13322944..d192b9a6 100644
--- a/plugins/gfm/src/main/kotlin/org/jetbrains/dokka/gfm/renderer/CommonmarkRenderer.kt
+++ b/plugins/gfm/src/main/kotlin/org/jetbrains/dokka/gfm/renderer/CommonmarkRenderer.kt
@@ -311,6 +311,22 @@ open class CommonmarkRenderer(
}
}
+ override fun StringBuilder.buildCodeBlock(code: ContentCodeBlock, pageContext: ContentPage) {
+ append("```")
+ append(code.language.ifEmpty { "kotlin" })
+ buildNewLine()
+ code.children.forEach { it.build(this, pageContext) }
+ buildNewLine()
+ append("```")
+ buildNewLine()
+ }
+
+ override fun StringBuilder.buildCodeInline(code: ContentCodeInline, pageContext: ContentPage) {
+ append("`")
+ code.children.forEach { it.build(this, pageContext) }
+ append("`")
+ }
+
private fun decorators(styles: Set<Style>) = buildString {
styles.forEach {
when (it) {