diff --git a/idea/src/org/jetbrains/kotlin/idea/kdoc/KDocRenderer.kt b/idea/src/org/jetbrains/kotlin/idea/kdoc/KDocRenderer.kt index 2276e897e53..8f91da47253 100644 --- a/idea/src/org/jetbrains/kotlin/idea/kdoc/KDocRenderer.kt +++ b/idea/src/org/jetbrains/kotlin/idea/kdoc/KDocRenderer.kt @@ -163,7 +163,9 @@ object KDocRenderer { // Avoid wrapping the entire converted contents in a
tag if it's just a single paragraph
val maybeSingleParagraph = markdownNode.children.singleOrNull { it.type != MarkdownTokenTypes.EOL }
return if (maybeSingleParagraph != null && !allowSingleParagraph) {
- maybeSingleParagraph.children.joinToString("") { it.toHtml() }
+ maybeSingleParagraph.children.joinToString("") {
+ if (it.text == "\n") " " else it.toHtml()
+ }
}
else {
markdownNode.toHtml()
diff --git a/idea/testData/editor/quickDoc/OnMethodUsageWithMultilineParam.kt b/idea/testData/editor/quickDoc/OnMethodUsageWithMultilineParam.kt
new file mode 100644
index 00000000000..ff2fb1dd5c5
--- /dev/null
+++ b/idea/testData/editor/quickDoc/OnMethodUsageWithMultilineParam.kt
@@ -0,0 +1,16 @@
+/**
+ * Some documentation
+ * on two lines.
+ *
+ * @param test String
+ * on two lines
+ */
+fun testMethod(test: String) {
+}
+
+fun test() {
+ Some documentation on two lines.public fun testMethod(test: String): Unit defined in root package in file OnMethodUsageWithMultilineParam.kt
\ No newline at end of file
diff --git a/idea/tests/org/jetbrains/kotlin/idea/editor/quickDoc/QuickDocProviderTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/editor/quickDoc/QuickDocProviderTestGenerated.java
index daaac4abafe..03b84ee9316 100644
--- a/idea/tests/org/jetbrains/kotlin/idea/editor/quickDoc/QuickDocProviderTestGenerated.java
+++ b/idea/tests/org/jetbrains/kotlin/idea/editor/quickDoc/QuickDocProviderTestGenerated.java
@@ -258,6 +258,12 @@ public class QuickDocProviderTestGenerated extends AbstractQuickDocProviderTest
doTest(fileName);
}
+ @TestMetadata("OnMethodUsageWithMultilineParam.kt")
+ public void testOnMethodUsageWithMultilineParam() throws Exception {
+ String fileName = KotlinTestUtils.navigationMetadata("idea/testData/editor/quickDoc/OnMethodUsageWithMultilineParam.kt");
+ doTest(fileName);
+ }
+
@TestMetadata("OnMethodUsageWithReceiver.kt")
public void testOnMethodUsageWithReceiver() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/editor/quickDoc/OnMethodUsageWithReceiver.kt");
test - String on two lines