From 721629f8e0fbbcb4d1193cf4af9c51388db9a306 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Thu, 28 Apr 2016 13:01:56 +0200 Subject: [PATCH] integrate Ingo Kegel's Dokka fix for rendering standalone * and _ characters --- idea/src/org/jetbrains/kotlin/idea/kdoc/KDocRenderer.kt | 7 +++++++ idea/testData/editor/quickDoc/OnMethodUsageWithMarkdown.kt | 4 ++++ 2 files changed, 11 insertions(+) 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:

Kotlin abdkas

//INFO:

C

//INFO:

Seethisclass

+//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.