From bfd9ffd13ed6b6916790f5f0de5f9523db71b22e Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Fri, 30 Jan 2015 17:59:15 +0100 Subject: load sections from KDoc PSI, not through Markdown extensions --- src/Markdown/MarkdownProcessor.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Markdown/MarkdownProcessor.kt') 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 = 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() -- cgit