diff options
author | Dmitry Jemerov <yole@jetbrains.com> | 2014-12-30 13:41:02 +0100 |
---|---|---|
committer | Dmitry Jemerov <yole@jetbrains.com> | 2014-12-30 13:41:02 +0100 |
commit | feca80b65581e688b1e9a3e807dfce2e17fd4a13 (patch) | |
tree | f090f9a361d90a5b9b8e554938933b8be7a6530c /src/Kotlin | |
parent | 8ef68182c02d8ec8fc33d0de0b7fcdef183e7ee7 (diff) | |
download | dokka-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')
-rw-r--r-- | src/Kotlin/ContentBuilder.kt | 19 |
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]; +} |