diff --git a/idea/src/org/jetbrains/kotlin/idea/kdoc/KDocRenderer.kt b/idea/src/org/jetbrains/kotlin/idea/kdoc/KDocRenderer.kt index 71a89944799..3a8fdc0b372 100644 --- a/idea/src/org/jetbrains/kotlin/idea/kdoc/KDocRenderer.kt +++ b/idea/src/org/jetbrains/kotlin/idea/kdoc/KDocRenderer.kt @@ -121,6 +121,10 @@ object KDocRenderer { } fun MarkdownNode.toHtml(): String { + if (node.type == MarkdownTokenTypes.WHITE_SPACE) { + return text // do not trim trailing whitespace + } + val sb = StringBuilder() visit { node, processChildren -> fun wrapChildren(tag: String, newline: Boolean = false) { diff --git a/idea/testData/editor/quickDoc/OnMethodUsageWithMarkdown.kt b/idea/testData/editor/quickDoc/OnMethodUsageWithMarkdown.kt index d2e802e953a..501528184df 100644 --- a/idea/testData/editor/quickDoc/OnMethodUsageWithMarkdown.kt +++ b/idea/testData/editor/quickDoc/OnMethodUsageWithMarkdown.kt @@ -23,7 +23,7 @@ fun test() { } //INFO: public fun testMethod(): Unit defined in root package
Some documentation. Bold underline code foo: bar (baz) quux 'apos'
This is emphasized text but text_with_underscores has to preserve the underscores. Single stars embedded in a word like Embedded*Star have to be preserved as well.
diff --git a/idea/testData/editor/quickDoc/OnMethodUsageWithReturnAndLink.kt b/idea/testData/editor/quickDoc/OnMethodUsageWithReturnAndLink.kt new file mode 100644 index 00000000000..79f856c02a5 --- /dev/null +++ b/idea/testData/editor/quickDoc/OnMethodUsageWithReturnAndLink.kt @@ -0,0 +1,18 @@ +/** +Some documentation + + * @param a Some int + * @param b String + * @return Return [a] and nothing else + */ +fun testMethod(a: Int, b: String) { + +} + +fun test() { +Some documentation
+//INFO:a - Some intb - String