diff options
Diffstat (limited to 'plugins/base')
-rw-r--r-- | plugins/base/src/main/kotlin/parsers/MarkdownParser.kt | 13 | ||||
-rw-r--r-- | plugins/base/src/main/kotlin/parsers/Parser.kt | 2 |
2 files changed, 5 insertions, 10 deletions
diff --git a/plugins/base/src/main/kotlin/parsers/MarkdownParser.kt b/plugins/base/src/main/kotlin/parsers/MarkdownParser.kt index dfb9f8e7..23e59f8b 100644 --- a/plugins/base/src/main/kotlin/parsers/MarkdownParser.kt +++ b/plugins/base/src/main/kotlin/parsers/MarkdownParser.kt @@ -25,10 +25,12 @@ open class MarkdownParser( private val externalDri: (String) -> DRI? ) : Parser() { + private lateinit var destinationLinksMap: Map<String, String> + private lateinit var text: String + override fun parseStringToDocNode(extractedString: String): DocTag { val gfmFlavourDescriptor = GFMFlavourDescriptor() - val markdownAstRoot: ASTNode = - IntellijMarkdownParser(gfmFlavourDescriptor).buildMarkdownTreeFromString(extractedString) + val markdownAstRoot = IntellijMarkdownParser(gfmFlavourDescriptor).buildMarkdownTreeFromString(extractedString) destinationLinksMap = getAllDestinationLinks(extractedString, markdownAstRoot).toMap() text = extractedString return visitNode(markdownAstRoot) @@ -36,13 +38,6 @@ open class MarkdownParser( override fun preparse(text: String) = text - private lateinit var destinationLinksMap: Map<String, String> - private lateinit var text: String - - override fun parse(text: String): DocumentationNode { - return DocumentationNode(listOf(Description(parseStringToDocNode(text)))) - } - private fun headersHandler(node: ASTNode) = DocTagsFromIElementFactory.getInstance( node.type, diff --git a/plugins/base/src/main/kotlin/parsers/Parser.kt b/plugins/base/src/main/kotlin/parsers/Parser.kt index 11b2fdcf..894fa82f 100644 --- a/plugins/base/src/main/kotlin/parsers/Parser.kt +++ b/plugins/base/src/main/kotlin/parsers/Parser.kt @@ -8,7 +8,7 @@ abstract class Parser { abstract fun preparse(text: String): String - open fun parse(text: String): DocumentationNode { + fun parse(text: String): DocumentationNode { val list = jkdocToListOfPairs(preparse(text)) |