From ab02494e6daa029ace3c9ef003aca681a739c3b5 Mon Sep 17 00:00:00 2001 From: Paweł Marks Date: Tue, 5 Nov 2019 19:01:30 +0100 Subject: New model --- .../kotlin/pages/MarkdownToContentConverter.kt | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'core/src/main/kotlin/pages') diff --git a/core/src/main/kotlin/pages/MarkdownToContentConverter.kt b/core/src/main/kotlin/pages/MarkdownToContentConverter.kt index 14b56226..9b249878 100644 --- a/core/src/main/kotlin/pages/MarkdownToContentConverter.kt +++ b/core/src/main/kotlin/pages/MarkdownToContentConverter.kt @@ -7,7 +7,6 @@ import org.jetbrains.dokka.DokkaResolutionFacade import org.jetbrains.dokka.MarkdownNode import org.jetbrains.dokka.Model.DocumentationNode import org.jetbrains.dokka.links.DRI -import org.jetbrains.dokka.visit import org.jetbrains.kotlin.idea.kdoc.resolveKDocLink class MarkdownToContentConverter( @@ -90,20 +89,21 @@ class MarkdownToContentConverter( } MarkdownElementTypes.SHORT_REFERENCE_LINK, MarkdownElementTypes.FULL_REFERENCE_LINK -> { - val descriptor = documentationNode.descriptor - if (descriptor != null) { + if (documentationNode.descriptors.isNotEmpty()) { val destinationNode = node.children.find { it.type == MarkdownElementTypes.LINK_DESTINATION } ?: node.children.first { it.type == MarkdownElementTypes.LINK_LABEL } val destination = destinationNode.children.find { it.type == MarkdownTokenTypes.TEXT }?.text - ?:destinationNode.text - - resolveKDocLink( - resolutionFacade.resolveSession.bindingContext, - resolutionFacade, - descriptor, - null, - destination.split('.') - ) + ?: destinationNode.text + + documentationNode.descriptors.flatMap { + resolveKDocLink( + resolutionFacade.resolveSession.bindingContext, + resolutionFacade, + it, + null, + destination.split('.') + ) + } .firstOrNull() ?.let { ContentLink(destination, DRI.from(it), platforms) } .let(::listOfNotNull) -- cgit