From 9559158bfeeb274e9ccf1b4563f1b23b42afc493 Mon Sep 17 00:00:00 2001 From: Ignat Beresnev Date: Wed, 5 Jul 2023 10:04:55 +0200 Subject: Decompose Kotlin/Java analysis (#3034) * Extract analysis into separate modules --- .../translators/documentables/briefFromContentNodes.kt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'plugins/base/src/main/kotlin/translators/documentables/briefFromContentNodes.kt') diff --git a/plugins/base/src/main/kotlin/translators/documentables/briefFromContentNodes.kt b/plugins/base/src/main/kotlin/translators/documentables/briefFromContentNodes.kt index bd54eedd..092077d6 100644 --- a/plugins/base/src/main/kotlin/translators/documentables/briefFromContentNodes.kt +++ b/plugins/base/src/main/kotlin/translators/documentables/briefFromContentNodes.kt @@ -1,15 +1,17 @@ package org.jetbrains.dokka.base.translators.documentables -import org.jetbrains.dokka.model.doc.* +import org.jetbrains.dokka.base.utils.firstNotNullOfOrNull +import org.jetbrains.dokka.model.doc.CustomDocTag +import org.jetbrains.dokka.model.doc.DocTag +import org.jetbrains.dokka.model.doc.P +import org.jetbrains.dokka.model.doc.Text import org.jetbrains.dokka.model.withDescendants import org.jetbrains.dokka.pages.* -import org.jetbrains.kotlin.util.firstNotNullResult -import org.jetbrains.kotlin.utils.addToStdlib.safeAs fun firstParagraphBrief(docTag: DocTag): DocTag? = when(docTag){ is P -> docTag - is CustomDocTag -> docTag.children.firstNotNullResult { firstParagraphBrief(it) } + is CustomDocTag -> docTag.children.firstNotNullOfOrNull { firstParagraphBrief(it) } is Text -> docTag else -> null } @@ -18,7 +20,7 @@ fun firstSentenceBriefFromContentNodes(description: List): List()?.isHtml == true } }){ + if(description.all { it.withDescendants().all { it is ContentGroup || (it as? ContentText)?.isHtml == true } }){ return description } -- cgit