aboutsummaryrefslogtreecommitdiff
path: root/src/Markdown
diff options
context:
space:
mode:
authorDmitry Jemerov <intelliyole@gmail.com>2015-01-30 19:04:34 +0100
committerDmitry Jemerov <intelliyole@gmail.com>2015-01-30 19:04:34 +0100
commitb5286f576f470ad1665a7b1acc9ea276bc1a0c18 (patch)
tree5cf3800e961b9da84b2db03707603865496f5ed0 /src/Markdown
parentb55b258574a01a02f906f5f12646ecacfc640e20 (diff)
parent0fac1d925b74f24002a4e1538088ce66c4b02cb9 (diff)
downloaddokka-b5286f576f470ad1665a7b1acc9ea276bc1a0c18.tar.gz
dokka-b5286f576f470ad1665a7b1acc9ea276bc1a0c18.tar.bz2
dokka-b5286f576f470ad1665a7b1acc9ea276bc1a0c18.zip
Merge pull request #24 from orangy/sections-rewrite
Use KDoc PSI instead of custom Markdown extensions to parse KDoc into sections
Diffstat (limited to 'src/Markdown')
-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()