aboutsummaryrefslogtreecommitdiff
path: root/src/Kotlin
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-02-10 18:11:15 +0100
committerDmitry Jemerov <yole@jetbrains.com>2015-02-10 18:11:15 +0100
commit92075236fb1356fe6023edff1e43fe3125b76c18 (patch)
tree00f97e05d2751bec65692f640ea56fb80a6d329d /src/Kotlin
parentf93ff9c31a815a448b03c3d76d21fd0a6d45c58d (diff)
downloaddokka-92075236fb1356fe6023edff1e43fe3125b76c18.tar.gz
dokka-92075236fb1356fe6023edff1e43fe3125b76c18.tar.bz2
dokka-92075236fb1356fe6023edff1e43fe3125b76c18.zip
fix handling of triple backticks
Diffstat (limited to 'src/Kotlin')
-rw-r--r--src/Kotlin/ContentBuilder.kt5
-rw-r--r--src/Kotlin/DocumentationBuilder.kt7
2 files changed, 11 insertions, 1 deletions
diff --git a/src/Kotlin/ContentBuilder.kt b/src/Kotlin/ContentBuilder.kt
index abe24917..60b0e9e9 100644
--- a/src/Kotlin/ContentBuilder.kt
+++ b/src/Kotlin/ContentBuilder.kt
@@ -95,6 +95,11 @@ public fun DocumentationBuilder.buildContentTo(tree: MarkdownNode, target: Conte
processChildren()
parent.append(nodeStack.pop())
}
+ MarkdownTokenTypes.CODE -> {
+ val block = ContentBlockCode()
+ block.append(ContentText(node.text))
+ parent.append(block)
+ }
MarkdownElementTypes.PARAGRAPH -> {
nodeStack.push(ContentParagraph())
processChildren()
diff --git a/src/Kotlin/DocumentationBuilder.kt b/src/Kotlin/DocumentationBuilder.kt
index c9c45214..d166fa82 100644
--- a/src/Kotlin/DocumentationBuilder.kt
+++ b/src/Kotlin/DocumentationBuilder.kt
@@ -45,7 +45,12 @@ class DocumentationBuilder(val session: ResolveSession, val options: Documentati
if (kdoc == null) {
return Content.Empty
}
- val tree = parseMarkdown(kdoc.getContent())
+ var kdocText = kdoc.getContent()
+ // workaround for code fence parsing problem in IJ markdown parser
+ if (kdocText.endsWith("```") || kdocText.endsWith("~~~")) {
+ kdocText += "\n"
+ }
+ val tree = parseMarkdown(kdocText)
//println(tree.toTestString())
val content = buildContent(tree)
if (kdoc is KDocSection) {