From d1937ab65bef189a48a55218a4194c0afb778053 Mon Sep 17 00:00:00 2001 From: Kamil Doległo Date: Tue, 7 May 2019 14:30:25 +0200 Subject: Fix some tests --- .../main/kotlin/Formats/MarkdownFormatService.kt | 24 +++++++++++++--------- .../main/kotlin/Formats/StructuredFormatService.kt | 13 ++++++------ 2 files changed, 20 insertions(+), 17 deletions(-) (limited to 'core/src') diff --git a/core/src/main/kotlin/Formats/MarkdownFormatService.kt b/core/src/main/kotlin/Formats/MarkdownFormatService.kt index 4265394f..71356619 100644 --- a/core/src/main/kotlin/Formats/MarkdownFormatService.kt +++ b/core/src/main/kotlin/Formats/MarkdownFormatService.kt @@ -159,16 +159,20 @@ open class MarkdownOutputBuilder(to: StringBuilder, } override fun appendParagraph(body: () -> Unit) { - if (inTableCell) { - ensureNewline() - body() - } else if (listStack.isNotEmpty()) { - body() - ensureNewline() - } else { - ensureParagraph() - body() - ensureParagraph() + when { + inTableCell -> { + ensureNewline() + body() + } + listStack.isNotEmpty() -> { + body() + ensureNewline() + } + else -> { + ensureParagraph() + body() + ensureParagraph() + } } } diff --git a/core/src/main/kotlin/Formats/StructuredFormatService.kt b/core/src/main/kotlin/Formats/StructuredFormatService.kt index 44b06e8b..a6c1b57f 100644 --- a/core/src/main/kotlin/Formats/StructuredFormatService.kt +++ b/core/src/main/kotlin/Formats/StructuredFormatService.kt @@ -111,7 +111,7 @@ abstract class StructuredOutputBuilder(val to: StringBuilder, open fun appendSinceKotlin(version: String) { appendParagraph { - appendText("Available since Kotlin: ") + appendText("Since: ") appendCode { appendText(version) } } } @@ -280,15 +280,13 @@ abstract class StructuredOutputBuilder(val to: StringBuilder, protected open fun appendPlatformsAsText(platforms: PlatformsData) { if (platforms.isNotEmpty()) { - appendLine() - appendText(platforms.keys.joinToString(prefix = "(", postfix = ")")) + appendText(platforms.keys.joinToString(prefix = "(", postfix = ") ")) } } protected open fun appendPlatforms(platforms: PlatformsData) { if (platforms.isNotEmpty()) { - appendLine() - appendText(platforms.keys.joinToString(prefix = "(", postfix = ")")) + appendText(platforms.keys.joinToString(prefix = "(", postfix = ") ")) } } @@ -775,9 +773,10 @@ abstract class StructuredOutputBuilder(val to: StringBuilder, appendPlatforms(platforms) } // appendHeader(level = 4) { - appendParagraph { +// appendParagraph { appendLink(memberLocation) - } + +// } // if (members.singleOrNull()?.kind != NodeKind.ExternalClass) { // appendPlatforms(platforms) // } -- cgit