aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2017-03-09 19:43:35 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2017-03-09 19:43:35 +0300
commitb84df9a0b8dbd2184c829d345bdad151230fc375 (patch)
tree97b4d228d38e6bffeedd857e9122eed88c3ee767 /core/src/main/kotlin
parent72f4602f1517e47ceb30cbe1f1d2326dfc0226e1 (diff)
downloaddokka-b84df9a0b8dbd2184c829d345bdad151230fc375.tar.gz
dokka-b84df9a0b8dbd2184c829d345bdad151230fc375.tar.bz2
dokka-b84df9a0b8dbd2184c829d345bdad151230fc375.zip
Fixed broken links to members of groupNode members
Diffstat (limited to 'core/src/main/kotlin')
-rw-r--r--core/src/main/kotlin/Formats/StructuredFormatService.kt7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/src/main/kotlin/Formats/StructuredFormatService.kt b/core/src/main/kotlin/Formats/StructuredFormatService.kt
index b4bb660e..84f91d9c 100644
--- a/core/src/main/kotlin/Formats/StructuredFormatService.kt
+++ b/core/src/main/kotlin/Formats/StructuredFormatService.kt
@@ -1,7 +1,6 @@
package org.jetbrains.dokka
import org.jetbrains.dokka.LanguageService.RenderMode
-import org.jetbrains.kotlin.utils.ifEmpty
import java.util.*
data class FormatLink(val text: String, val href: String)
@@ -188,6 +187,9 @@ abstract class StructuredOutputBuilder(val to: StringBuilder,
if (to.owner?.kind == NodeKind.GroupNode)
return link(from, to.owner!!, extension, name)
+ if (from.owner?.kind == NodeKind.GroupNode)
+ return link(from.owner!!, to, extension, name)
+
return FormatLink(name(to), locationService.relativePathToLocation(from, to))
}
@@ -226,7 +228,6 @@ abstract class StructuredOutputBuilder(val to: StringBuilder,
for ((index, item) in path.withIndex()) {
if (index > 0) {
appendBreadcrumbSeparator()
-
}
appendLink(item)
}
@@ -248,7 +249,7 @@ abstract class StructuredOutputBuilder(val to: StringBuilder,
open inner class PageBuilder(val nodes: Iterable<DocumentationNode>, val noHeader: Boolean = false) {
open fun build() {
val breakdownByLocation = nodes.groupBy { node ->
- node.path.filterNot { it.name.isEmpty() }.map { link(node, it) }
+ node.path.filterNot { it.name.isEmpty() }.map { link(node, it) }.distinct()
}
for ((path, nodes) in breakdownByLocation) {