From e9ab5d88150323067672661d37f8d7f8b146311d Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Fri, 27 Oct 2017 03:46:49 +0300 Subject: #228: Correctly render multiline indented code blocks Fix #228 --- core/src/main/kotlin/Kotlin/ContentBuilder.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'core/src/main/kotlin/Kotlin') 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 -> { -- cgit