aboutsummaryrefslogtreecommitdiff
path: root/src/Kotlin/ContentBuilder.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/Kotlin/ContentBuilder.kt')
-rw-r--r--src/Kotlin/ContentBuilder.kt19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/Kotlin/ContentBuilder.kt b/src/Kotlin/ContentBuilder.kt
index 0c82a522..0143feed 100644
--- a/src/Kotlin/ContentBuilder.kt
+++ b/src/Kotlin/ContentBuilder.kt
@@ -101,6 +101,17 @@ public fun DocumentationBuilder.buildContent(tree: MarkdownNode, descriptor: Dec
processChildren()
parent.append(nodeStack.pop())
}
+ MarkdownTokenTypes.COLON -> {
+ // TODO fix markdown parser
+ if (!isColonAfterSectionLabel(node)) {
+ parent.append(ContentText(node.text))
+ }
+ }
+ MarkdownTokenTypes.DOUBLE_QUOTE,
+ MarkdownTokenTypes.LT,
+ MarkdownTokenTypes.GT -> {
+ parent.append(ContentText(node.text))
+ }
else -> {
processChildren()
}
@@ -147,4 +158,10 @@ private fun DocumentationBuilder.resolveInScope(functionName: String, scope: Jet
}
return symbol
-} \ No newline at end of file
+}
+
+private fun isColonAfterSectionLabel(node: MarkdownNode): Boolean {
+ val parent = node.parent
+ return parent != null && parent.type == MarkdownElementTypes.SECTION && parent.children.size() >= 2 &&
+ node == parent.children[1];
+}