aboutsummaryrefslogtreecommitdiff
path: root/src/Kotlin/ContentBuilder.kt
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2014-12-30 13:41:02 +0100
committerDmitry Jemerov <yole@jetbrains.com>2014-12-30 13:41:02 +0100
commitfeca80b65581e688b1e9a3e807dfce2e17fd4a13 (patch)
treef090f9a361d90a5b9b8e554938933b8be7a6530c /src/Kotlin/ContentBuilder.kt
parent8ef68182c02d8ec8fc33d0de0b7fcdef183e7ee7 (diff)
downloaddokka-feca80b65581e688b1e9a3e807dfce2e17fd4a13.tar.gz
dokka-feca80b65581e688b1e9a3e807dfce2e17fd4a13.tar.bz2
dokka-feca80b65581e688b1e9a3e807dfce2e17fd4a13.zip
add test for html escaping; fix special characters eaten from output
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];
+}