aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/Kotlin
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2017-10-27 03:46:49 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2017-11-02 17:59:50 +0300
commite9ab5d88150323067672661d37f8d7f8b146311d (patch)
treed2528af6c367fc0e22bb9c2cf2009c801cc8c1ea /core/src/main/kotlin/Kotlin
parentd6d320eb13a24fb8e70df0ba11effabe429f0fd4 (diff)
downloaddokka-e9ab5d88150323067672661d37f8d7f8b146311d.tar.gz
dokka-e9ab5d88150323067672661d37f8d7f8b146311d.tar.bz2
dokka-e9ab5d88150323067672661d37f8d7f8b146311d.zip
#228: Correctly render multiline indented code blocks
Fix #228
Diffstat (limited to 'core/src/main/kotlin/Kotlin')
-rw-r--r--core/src/main/kotlin/Kotlin/ContentBuilder.kt9
1 files changed, 6 insertions, 3 deletions
diff --git a/core/src/main/kotlin/Kotlin/ContentBuilder.kt b/core/src/main/kotlin/Kotlin/ContentBuilder.kt
index 771bc44b..c60625a4 100644
--- a/core/src/main/kotlin/Kotlin/ContentBuilder.kt
+++ b/core/src/main/kotlin/Kotlin/ContentBuilder.kt
@@ -110,9 +110,12 @@ fun buildContentTo(tree: MarkdownNode, target: ContentBlock, linkResolver: LinkR
}
MarkdownTokenTypes.CODE_LINE -> {
- val block = ContentBlockCode()
- block.append(ContentText(node.text))
- parent.append(block)
+ val content = ContentText(node.text)
+ if (parent is ContentBlockCode) {
+ parent.append(content)
+ } else {
+ parent.append(ContentBlockCode().apply { append(content) })
+ }
}
MarkdownTokenTypes.TEXT -> {