diff options
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/main/kotlin/Formats/StructuredFormatService.kt | 7 | ||||
-rw-r--r-- | core/src/test/kotlin/format/KotlinWebSiteFormatTest.kt | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/core/src/main/kotlin/Formats/StructuredFormatService.kt b/core/src/main/kotlin/Formats/StructuredFormatService.kt index 15a4dfba..4f64baa1 100644 --- a/core/src/main/kotlin/Formats/StructuredFormatService.kt +++ b/core/src/main/kotlin/Formats/StructuredFormatService.kt @@ -256,8 +256,11 @@ abstract class StructuredFormatService(locationService: LocationService, } for (section in content.sections.filter { it.subjectName == null }) { - appendLine(to, formatStrong(formatText(section.tag))) - appendLine(to, formatText(location, section)) + val sectionText = buildString { + appendLine(this, formatStrong(formatText(section.tag))) + append(formatText(location, section)) + } + appendParagraph(to, sectionText) } } diff --git a/core/src/test/kotlin/format/KotlinWebSiteFormatTest.kt b/core/src/test/kotlin/format/KotlinWebSiteFormatTest.kt index a96139fd..d4738b2f 100644 --- a/core/src/test/kotlin/format/KotlinWebSiteFormatTest.kt +++ b/core/src/test/kotlin/format/KotlinWebSiteFormatTest.kt @@ -11,6 +11,10 @@ class KotlinWebSiteFormatTest { verifyKWSNodeByName("sample", "foo") } + @Test fun returnTag() { + verifyKWSNodeByName("returnTag", "indexOf") + } + private fun verifyKWSNodeByName(fileName: String, name: String) { verifyOutput("testdata/format/website/$fileName.kt", ".md") { model, output -> kwsService.appendNodes(tempLocation, output, model.members.single().members.filter { it.name == name }) |