aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt
diff options
context:
space:
mode:
authorAndrzej Ratajczak <andrzej.ratajczak98@gmail.com>2020-07-14 19:22:17 +0200
committerSebastian Sellmair <34319766+sellmair@users.noreply.github.com>2020-07-15 16:01:44 +0200
commitdcd4c1c5bc13e7bb058bcd055aa2b02d7d39e9c1 (patch)
tree7ff9003f55c5890ca5e7d47a0f2adc58ee363201 /plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt
parentac19f61e253e9d168898fe3a0f64221b697ad8be (diff)
downloaddokka-dcd4c1c5bc13e7bb058bcd055aa2b02d7d39e9c1.tar.gz
dokka-dcd4c1c5bc13e7bb058bcd055aa2b02d7d39e9c1.tar.bz2
dokka-dcd4c1c5bc13e7bb058bcd055aa2b02d7d39e9c1.zip
Fix presenting inline code in KDoc
Diffstat (limited to 'plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt')
-rw-r--r--plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt9
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt b/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt
index 75fbb187..afee1b33 100644
--- a/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt
+++ b/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt
@@ -74,7 +74,11 @@ abstract class DefaultRenderer<T>(
nodes.forEach { it.build(this, pageContext, sourceSetRestriction) }
}
- open fun T.buildCode(code: ContentCode, pageContext: ContentPage) {
+ open fun T.buildCodeBlock(code: ContentCodeBlock, pageContext: ContentPage) {
+ code.children.forEach { it.build(this, pageContext) }
+ }
+
+ open fun T.buildCodeInline(code: ContentCodeInline, pageContext: ContentPage) {
code.children.forEach { it.build(this, pageContext) }
}
@@ -102,7 +106,8 @@ abstract class DefaultRenderer<T>(
when (node) {
is ContentText -> buildText(node)
is ContentHeader -> buildHeader(node, pageContext, sourceSetRestriction)
- is ContentCode -> buildCode(node, pageContext)
+ is ContentCodeBlock -> buildCodeBlock(node, pageContext)
+ is ContentCodeInline -> buildCodeInline(node, pageContext)
is ContentDRILink ->
buildLink(locationProvider.resolve(node.address, node.sourceSets, pageContext)) {
buildLinkText(node.children, pageContext, sourceSetRestriction)