From 21b2fcb46a10acc2afdf94639cd208d15856fdc3 Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Thu, 3 Nov 2016 12:50:37 +0300 Subject: Fix for KT-14076 : empty visible div's (#108) Fix for KT-14076 : empty visible div's --- .../kotlin/Formats/KotlinWebsiteFormatService.kt | 5 +++- .../test/kotlin/format/KotlinWebSiteFormatTest.kt | 4 +++ core/testdata/format/website/overloadGroup.kt | 15 ++++++++++ core/testdata/format/website/overloadGroup.md | 34 ++++++++++++++++++++++ core/testdata/format/website/sample.md | 9 ++++-- 5 files changed, 64 insertions(+), 3 deletions(-) create mode 100644 core/testdata/format/website/overloadGroup.kt create mode 100644 core/testdata/format/website/overloadGroup.md (limited to 'core') diff --git a/core/src/main/kotlin/Formats/KotlinWebsiteFormatService.kt b/core/src/main/kotlin/Formats/KotlinWebsiteFormatService.kt index 03cf7fc8..bc9358ac 100644 --- a/core/src/main/kotlin/Formats/KotlinWebsiteFormatService.kt +++ b/core/src/main/kotlin/Formats/KotlinWebsiteFormatService.kt @@ -52,8 +52,11 @@ class KotlinWebsiteOutputBuilder(to: StringBuilder, } override fun appendAsOverloadGroup(to: StringBuilder, block: () -> Unit) { + to.append("
") + ensureParagraph() block() - to.append("
") + ensureParagraph() + to.append("
") } override fun appendLink(href: String, body: () -> Unit) = wrap("", "", body) diff --git a/core/src/test/kotlin/format/KotlinWebSiteFormatTest.kt b/core/src/test/kotlin/format/KotlinWebSiteFormatTest.kt index e6ef792a..e7419ec8 100644 --- a/core/src/test/kotlin/format/KotlinWebSiteFormatTest.kt +++ b/core/src/test/kotlin/format/KotlinWebSiteFormatTest.kt @@ -15,6 +15,10 @@ class KotlinWebSiteFormatTest { verifyKWSNodeByName("returnTag", "indexOf") } + @Test fun overloadGroup() { + verifyKWSNodeByName("overloadGroup", "magic") + } + private fun verifyKWSNodeByName(fileName: String, name: String) { verifyOutput("testdata/format/website/$fileName.kt", ".md") { model, output -> kwsService.createOutputBuilder(output, tempLocation).appendNodes(model.members.single().members.filter { it.name == name }) diff --git a/core/testdata/format/website/overloadGroup.kt b/core/testdata/format/website/overloadGroup.kt new file mode 100644 index 00000000..5bc98e3d --- /dev/null +++ b/core/testdata/format/website/overloadGroup.kt @@ -0,0 +1,15 @@ +/** + * @param spell The text of spell, often distributed on scrolls + * @return Spell ID for future casts + */ +fun magic(spell: String): Int { + +} + +/** + * @param spell Spell ID of previously casted spell + * @return Spell ID for future casts + */ +fun magic(spell: Int): Int { + +} \ No newline at end of file diff --git a/core/testdata/format/website/overloadGroup.md b/core/testdata/format/website/overloadGroup.md new file mode 100644 index 00000000..81cb7822 --- /dev/null +++ b/core/testdata/format/website/overloadGroup.md @@ -0,0 +1,34 @@ +--- +title: magic - test +layout: api +--- + +
test / magic
+ +# magic + +
+ +
fun magic(spell: String): Int
+ +### Parameters + +spell - The text of spell, often distributed on scrolls + +**Return** +Spell ID for future casts + +
+ +
+ +
fun magic(spell: Int): Int
+ +### Parameters + +spell - Spell ID of previously casted spell + +**Return** +Spell ID for future casts + +
\ No newline at end of file diff --git a/core/testdata/format/website/sample.md b/core/testdata/format/website/sample.md index 3a52379b..1a683da7 100644 --- a/core/testdata/format/website/sample.md +++ b/core/testdata/format/website/sample.md @@ -7,6 +7,8 @@ layout: api # foo +
+
fun foo(): Int
Groups elements of the original sequence by the key returned by the given keySelector function @@ -18,7 +20,10 @@ if (true) { } ``` -
+
+ +
fun foo(i: Int): Int
-
\ No newline at end of file + +
\ No newline at end of file -- cgit