diff --git a/idea/src/org/jetbrains/kotlin/idea/JetQuickDocumentationProvider.java b/idea/src/org/jetbrains/kotlin/idea/JetQuickDocumentationProvider.java
index 522ad38407e..ce40acac926 100644
--- a/idea/src/org/jetbrains/kotlin/idea/JetQuickDocumentationProvider.java
+++ b/idea/src/org/jetbrains/kotlin/idea/JetQuickDocumentationProvider.java
@@ -26,6 +26,7 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.asJava.KotlinLightMethod;
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor;
import org.jetbrains.kotlin.idea.caches.resolve.ResolvePackage;
+import org.jetbrains.kotlin.idea.kdoc.KDocRenderer;
import org.jetbrains.kotlin.kdoc.KdocPackage;
import org.jetbrains.kotlin.kdoc.psi.impl.KDocTag;
import org.jetbrains.kotlin.psi.JetDeclaration;
@@ -92,7 +93,7 @@ public class JetQuickDocumentationProvider extends AbstractDocumentationProvider
KDocTag comment = KdocPackage.findKDoc(declarationDescriptor);
if (comment != null) {
- renderedDecl = renderedDecl + "
" + org.jetbrains.kotlin.idea.kdoc.KdocPackage.renderKDoc(comment);
+ renderedDecl = renderedDecl + "
" + KDocRenderer.INSTANCE$.renderKDoc(comment);
}
return renderedDecl;
diff --git a/idea/src/org/jetbrains/kotlin/idea/kdoc/KDocRenderer.kt b/idea/src/org/jetbrains/kotlin/idea/kdoc/KDocRenderer.kt
index 3a1d35900f3..d24e8ad4163 100644
--- a/idea/src/org/jetbrains/kotlin/idea/kdoc/KDocRenderer.kt
+++ b/idea/src/org/jetbrains/kotlin/idea/kdoc/KDocRenderer.kt
@@ -20,47 +20,49 @@ import org.jetbrains.kotlin.kdoc.psi.impl.KDocTag
import com.intellij.openapi.util.text.StringUtil
import org.jetbrains.kotlin.kdoc.psi.impl.KDocSection
-fun renderKDoc(docComment: KDocTag): String {
- val content = docComment.getContent()
- val result = StringBuilder("
") - result.append(markdownToHtml(content)) - if (docComment is KDocSection) { - val paramTags = docComment.findTagsByName("param").filter { it.getSubjectName() != null } - renderTagList(paramTags, "Parameters", result) +object KDocRenderer { + fun renderKDoc(docComment: KDocTag): String { + val content = docComment.getContent() + val result = StringBuilder("
") + result.append(markdownToHtml(content)) + if (docComment is KDocSection) { + val paramTags = docComment.findTagsByName("param").filter { it.getSubjectName() != null } + renderTagList(paramTags, "Parameters", result) - renderTag(docComment.findTagByName("return"), "Returns", result) + renderTag(docComment.findTagByName("return"), "Returns", result) - val throwsTags = (docComment.findTagsByName("exception").union(docComment.findTagsByName("throws"))) - .filter { it.getSubjectName() != null } - renderTagList(throwsTags, "Throws", result) + val throwsTags = (docComment.findTagsByName("exception").union(docComment.findTagsByName("throws"))) + .filter { it.getSubjectName() != null } + renderTagList(throwsTags, "Throws", result) - renderTag(docComment.findTagByName("author"), "Author", result) - renderTag(docComment.findTagByName("since"), "Since", result) + renderTag(docComment.findTagByName("author"), "Author", result) + renderTag(docComment.findTagByName("since"), "Since", result) + } + result.append("
") + return result.toString() } - result.append("") - return result.toString() -} -private fun renderTagList(tags: List${it.getSubjectName()} - ${markdownToHtml(it.getContent().trimLeading())}${it.getSubjectName()} - ${markdownToHtml(it.getContent().trimLeading())}