From 2bdb222516df07519bf5415941e88ce9a24993ea Mon Sep 17 00:00:00 2001
From: Dmitry Jemerov ")
- 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("
" + 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("
${it.getSubjectName()} - ${markdownToHtml(it.getContent().trimLeading())}${it.getSubjectName()} - ${markdownToHtml(it.getContent().trimLeading())}