From e93b629e4b2fa70330d94b8cb77f3ae34d1a9960 Mon Sep 17 00:00:00 2001
From: Ilya Ryzhenkov <orangy@jetbrains.com>
Date: Mon, 29 Sep 2014 22:29:41 +0400
Subject: Fix rendering

---
 src/Formats/StructuredFormatService.kt | 12 +++++-------
 src/Kotlin/DocumentationContext.kt     |  2 +-
 2 files changed, 6 insertions(+), 8 deletions(-)

(limited to 'src')

diff --git a/src/Formats/StructuredFormatService.kt b/src/Formats/StructuredFormatService.kt
index b1e614f6..40feaf21 100644
--- a/src/Formats/StructuredFormatService.kt
+++ b/src/Formats/StructuredFormatService.kt
@@ -32,14 +32,12 @@ public abstract class StructuredFormatService(val locationService: LocationServi
         return nodes.map { formatText(it) }.join("")
     }
 
-    open fun formatText(text: ContentNode): String {
+    open fun formatText(node: ContentNode): String {
         return StringBuilder {
-            for (node in text.children) {
-                when (node) {
-                    is ContentText -> append(node.text)
-                    is ContentEmphasis -> append(formatBold(formatText(node.children)))
-                    else -> append(formatText(node.children))
-                }
+            when (node) {
+                is ContentText -> append(node.text)
+                is ContentEmphasis -> append(formatBold(formatText(node.children)))
+                else -> append(formatText(node.children))
             }
         }.toString()
     }
diff --git a/src/Kotlin/DocumentationContext.kt b/src/Kotlin/DocumentationContext.kt
index 1491aa2d..ec9e748f 100644
--- a/src/Kotlin/DocumentationContext.kt
+++ b/src/Kotlin/DocumentationContext.kt
@@ -23,7 +23,7 @@ public class DocumentationContext(val bindingContext: BindingContext) {
     fun parseDocumentation(descriptor: DeclarationDescriptor): Content {
         val docText = bindingContext.getDocumentationElements(descriptor).map { it.extractText() }.join("\n")
         val tree = MarkdownProcessor.parse(docText)
-        println(tree.toTestString())
+        //println(tree.toTestString())
         val content = tree.toContent()
         return content
     }
-- 
cgit