From 4a4601d6ccd1552c2254d43965f8b3bca7732e24 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Fri, 13 Feb 2015 12:56:03 +0100 Subject: buildContent/buildContentTo don't need to be extension functions of DocumentationBuilder --- src/Kotlin/ContentBuilder.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/Kotlin/ContentBuilder.kt b/src/Kotlin/ContentBuilder.kt index 4d6938bf..6bb32f31 100644 --- a/src/Kotlin/ContentBuilder.kt +++ b/src/Kotlin/ContentBuilder.kt @@ -10,13 +10,13 @@ import org.intellij.markdown.* import org.jetbrains.kotlin.psi.JetDeclarationWithBody import org.jetbrains.kotlin.psi.JetBlockExpression -public fun DocumentationBuilder.buildContent(tree: MarkdownNode): Content { +public fun buildContent(tree: MarkdownNode): Content { val result = Content() buildContentTo(tree, result) return result } -public fun DocumentationBuilder.buildContentTo(tree: MarkdownNode, target: ContentBlock) { +public fun buildContentTo(tree: MarkdownNode, target: ContentBlock) { // println(tree.toTestString()) val nodeStack = ArrayDeque() nodeStack.push(target) @@ -123,7 +123,7 @@ public fun DocumentationBuilder.buildContentTo(tree: MarkdownNode, target: Conte private fun keepWhitespace(node: ContentNode) = node is ContentParagraph || node is ContentSection -public fun DocumentationBuilder.buildInlineContentTo(tree: MarkdownNode, target: ContentBlock) { +public fun buildInlineContentTo(tree: MarkdownNode, target: ContentBlock) { val inlineContent = tree.children.singleOrNull { it.type == MarkdownElementTypes.PARAGRAPH }?.children ?: listOf(tree) inlineContent.forEach { buildContentTo(it, target) -- cgit