aboutsummaryrefslogtreecommitdiff
path: root/src/Markdown/MarkdownProcessor.kt
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-01-30 17:59:15 +0100
committerDmitry Jemerov <yole@jetbrains.com>2015-01-30 17:59:15 +0100
commitbfd9ffd13ed6b6916790f5f0de5f9523db71b22e (patch)
tree214ae0ff76e8b35841947b639ce3c2022ad72fec /src/Markdown/MarkdownProcessor.kt
parentb55b258574a01a02f906f5f12646ecacfc640e20 (diff)
downloaddokka-bfd9ffd13ed6b6916790f5f0de5f9523db71b22e.tar.gz
dokka-bfd9ffd13ed6b6916790f5f0de5f9523db71b22e.tar.bz2
dokka-bfd9ffd13ed6b6916790f5f0de5f9523db71b22e.zip
load sections from KDoc PSI, not through Markdown extensions
Diffstat (limited to 'src/Markdown/MarkdownProcessor.kt')
-rw-r--r--src/Markdown/MarkdownProcessor.kt6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Markdown/MarkdownProcessor.kt b/src/Markdown/MarkdownProcessor.kt
index 05c4a7ec..7e601905 100644
--- a/src/Markdown/MarkdownProcessor.kt
+++ b/src/Markdown/MarkdownProcessor.kt
@@ -3,7 +3,7 @@ package org.jetbrains.dokka
import org.intellij.markdown.*
import org.intellij.markdown.ast.*
import org.intellij.markdown.parser.*
-import org.intellij.markdown.parser.dialects.KDocMarkerProcessor
+import org.intellij.markdown.parser.dialects.commonmark.CommonMarkMarkerProcessor
class MarkdownNode(val node: ASTNode, val parent: MarkdownNode?, val markdown: String) {
val children: List<MarkdownNode> = node.children.map { MarkdownNode(it, this, markdown) }
@@ -134,12 +134,12 @@ public fun MarkdownNode.toHtml(): String {
fun parseMarkdown(markdown: String): MarkdownNode {
if (markdown.isEmpty())
return MarkdownNode(LeafASTNode(MarkdownElementTypes.MARKDOWN_FILE, 0, 0), null, markdown)
- return MarkdownNode(MarkdownParser(KDocMarkerProcessor.Factory()).buildMarkdownTreeFromString(markdown), null, markdown)
+ return MarkdownNode(MarkdownParser(CommonMarkMarkerProcessor.Factory()).buildMarkdownTreeFromString(markdown), null, markdown)
}
fun markdownToHtml(markdown: String): String {
- val tree = MarkdownParser(KDocMarkerProcessor.Factory()).buildMarkdownTreeFromString(markdown)
+ val tree = MarkdownParser(CommonMarkMarkerProcessor.Factory()).buildMarkdownTreeFromString(markdown)
val markdownTree = MarkdownNode(tree, null, markdown)
val ast = markdownTree.toTestString()
return markdownTree.toHtml()