diff --git a/idea/src/org/jetbrains/kotlin/idea/kdoc/KDocRenderer.kt b/idea/src/org/jetbrains/kotlin/idea/kdoc/KDocRenderer.kt index f752440ac98..71a89944799 100644 --- a/idea/src/org/jetbrains/kotlin/idea/kdoc/KDocRenderer.kt +++ b/idea/src/org/jetbrains/kotlin/idea/kdoc/KDocRenderer.kt @@ -210,6 +210,13 @@ object KDocRenderer { } } + MarkdownTokenTypes.EMPH -> { + val parentNodeType = node.parent?.type + if (parentNodeType != MarkdownElementTypes.EMPH && parentNodeType != MarkdownElementTypes.STRONG) { + sb.append(node.text) + } + } + else -> { processChildren() } diff --git a/idea/testData/editor/quickDoc/OnMethodUsageWithMarkdown.kt b/idea/testData/editor/quickDoc/OnMethodUsageWithMarkdown.kt index a151af0aea7..d2e802e953a 100644 --- a/idea/testData/editor/quickDoc/OnMethodUsageWithMarkdown.kt +++ b/idea/testData/editor/quickDoc/OnMethodUsageWithMarkdown.kt @@ -7,6 +7,9 @@ * [C] * * [See **this** class][C] + * + * 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. */ fun testMethod() { @@ -23,3 +26,4 @@ fun test() { //INFO:
//INFO: //INFO: +//INFO: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.