aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/Formats
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2017-02-24 14:44:55 +0100
committerDmitry Jemerov <yole@jetbrains.com>2017-02-24 14:44:55 +0100
commit0f9dac9ea2137fe5935566d84cb2f5264be1a8ba (patch)
tree1064587501fb4e6bad5f4542ddcabfbb31f99749 /core/src/main/kotlin/Formats
parent004fc0c4eaf9d1ecaa78cf97f7d0fb2e91405031 (diff)
parent2ceff9c41cff42b7fb3ffe75ea36a7c570f3615b (diff)
downloaddokka-0f9dac9ea2137fe5935566d84cb2f5264be1a8ba.tar.gz
dokka-0f9dac9ea2137fe5935566d84cb2f5264be1a8ba.tar.bz2
dokka-0f9dac9ea2137fe5935566d84cb2f5264be1a8ba.zip
Merge remote-tracking branch 'origin/0.9.14/BlankLines'
# Conflicts: # core/src/test/kotlin/format/HtmlFormatTest.kt # core/src/test/kotlin/format/MarkdownFormatTest.kt
Diffstat (limited to 'core/src/main/kotlin/Formats')
-rw-r--r--core/src/main/kotlin/Formats/StructuredFormatService.kt9
1 files changed, 3 insertions, 6 deletions
diff --git a/core/src/main/kotlin/Formats/StructuredFormatService.kt b/core/src/main/kotlin/Formats/StructuredFormatService.kt
index 3cfc96a2..6e887c05 100644
--- a/core/src/main/kotlin/Formats/StructuredFormatService.kt
+++ b/core/src/main/kotlin/Formats/StructuredFormatService.kt
@@ -153,12 +153,9 @@ abstract class StructuredOutputBuilder(val to: StringBuilder,
is ContentBlockSampleCode, is ContentBlockCode -> {
content as ContentBlockCode
fun ContentBlockCode.appendBlockCodeContent() {
- for ((index, contentNode) in this.children.withIndex()) {
- appendContent(contentNode)
- if (index < this.children.size - 1) {
- to.append("\n")
- }
- }
+ children
+ .dropWhile { it is ContentText && it.text.isBlank() }
+ .forEach { appendContent(it) }
}
when (content) {
is ContentBlockSampleCode ->