From 7d4e133fa46b9ab358472398ae03cbefbf49d9e3 Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Wed, 3 Oct 2018 07:59:04 +0300 Subject: Correctly lookup summary for group nodes --- core/src/main/kotlin/Model/DocumentationNode.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/src/main/kotlin/Model/DocumentationNode.kt b/core/src/main/kotlin/Model/DocumentationNode.kt index 5607c6d3..84f9a453 100644 --- a/core/src/main/kotlin/Model/DocumentationNode.kt +++ b/core/src/main/kotlin/Model/DocumentationNode.kt @@ -77,7 +77,10 @@ open class DocumentationNode(val name: String, private set val summary: ContentNode get() = when (kind) { - NodeKind.GroupNode -> this.origins.first().summary + NodeKind.GroupNode -> this.origins + .map { it.content } + .firstOrNull { !it.isEmpty() } + ?.summary ?: ContentEmpty else -> content.summary } -- cgit