aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin/parsers/MarkdownParser.kt
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/base/src/main/kotlin/parsers/MarkdownParser.kt')
-rw-r--r--plugins/base/src/main/kotlin/parsers/MarkdownParser.kt13
1 files changed, 4 insertions, 9 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,