Skip to content

Commit

Permalink
Avoid double line breaks in declarations list
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnatBeresnev committed Jul 27, 2022
1 parent 8779f50 commit 4ce210b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ open class HtmlRenderer(
}.stripDiv()
})

val isPageWithOverloadedFunctions = node.dci.kind == ContentKind.Main && pageContext is MemberPage
val isPageWithOverloadedFunctions = pageContext is MemberPage
&& pageContext.documentables().let { it.isNotEmpty() && it.all { d -> d is DFunction } }

val contentOfSourceSet = mutableListOf<ContentNode>()
Expand All @@ -293,7 +293,8 @@ open class HtmlRenderer(
?: if (index != distinct.size - 1) ContentBreakLine(it.key) else null
)

if (index != distinct.size - 1) {
// content kind main is important for declarations list to avoid double line breaks
if (node.dci.kind == ContentKind.Main && index != distinct.size - 1) {
if (isPageWithOverloadedFunctions) {
// hacky, but there's no other place to modify overloads page atm;
// add some spacing and distinction between function overloads
Expand Down

0 comments on commit 4ce210b

Please sign in to comment.