diff options
author | Paweł Marks <pmarks@virtuslab.com> | 2019-11-05 19:01:30 +0100 |
---|---|---|
committer | Paweł Marks <pmarks@virtuslab.com> | 2019-11-05 19:06:21 +0100 |
commit | ab02494e6daa029ace3c9ef003aca681a739c3b5 (patch) | |
tree | fb3e3bc28ab746b75dc1721936b2f7d493cd48d8 /core/src/main/kotlin/pages | |
parent | e67355a8a48fa8df9d1c6a91a5d854bb183e3759 (diff) | |
download | dokka-ab02494e6daa029ace3c9ef003aca681a739c3b5.tar.gz dokka-ab02494e6daa029ace3c9ef003aca681a739c3b5.tar.bz2 dokka-ab02494e6daa029ace3c9ef003aca681a739c3b5.zip |
New model
Diffstat (limited to 'core/src/main/kotlin/pages')
-rw-r--r-- | core/src/main/kotlin/pages/MarkdownToContentConverter.kt | 24 |
1 files changed, 12 insertions, 12 deletions
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) |