File tree Expand file tree Collapse file tree 3 files changed +24
-2
lines changed
src/org/jetbrains/kotlin/idea/kdoc
tests/org/jetbrains/kotlin/idea/editor/quickDoc Expand file tree Collapse file tree 3 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -203,10 +203,12 @@ object KDocRenderer {
203
203
MarkdownTokenTypes .RPAREN ,
204
204
MarkdownTokenTypes .LBRACKET ,
205
205
MarkdownTokenTypes .RBRACKET ,
206
- MarkdownTokenTypes .EXCLAMATION_MARK ,
207
- MarkdownTokenTypes .CODE_FENCE_CONTENT -> {
206
+ MarkdownTokenTypes .EXCLAMATION_MARK -> {
208
207
sb.append(nodeText)
209
208
}
209
+ MarkdownTokenTypes .CODE_FENCE_CONTENT -> {
210
+ sb.append(nodeText.htmlEscape())
211
+ }
210
212
MarkdownTokenTypes .EOL -> {
211
213
val parentType = node.parent?.type
212
214
if (parentType == MarkdownElementTypes .CODE_BLOCK || parentType == MarkdownElementTypes .CODE_FENCE ) {
Original file line number Diff line number Diff line change
1
+ /* *
2
+ * Code block:
3
+ * ``` kotlin
4
+ * A<T>
5
+ * ```
6
+ * Code span:
7
+ * `<T>` is type parameter
8
+ */
9
+ class < caret> A <T >
10
+
11
+ // INFO: <b>public</b> <b>final</b> <b>class</b> A<T> <i>defined in</i> root package<p>Code block:</p>
12
+ // INFO: <pre><code>
13
+ // INFO: A<T>
14
+ // INFO: </code></pre><p>Code span: <code><T></code> is type parameter</p>
Original file line number Diff line number Diff line change @@ -72,6 +72,12 @@ public void testConstructorVarParameter() throws Exception {
72
72
doTest (fileName );
73
73
}
74
74
75
+ @ TestMetadata ("EscapeHtmlInsideCodeBlocks.kt" )
76
+ public void testEscapeHtmlInsideCodeBlocks () throws Exception {
77
+ String fileName = KotlinTestUtils .navigationMetadata ("idea/testData/editor/quickDoc/EscapeHtmlInsideCodeBlocks.kt" );
78
+ doTest (fileName );
79
+ }
80
+
75
81
@ TestMetadata ("JavaClassUsedInKotlin.kt" )
76
82
public void testJavaClassUsedInKotlin () throws Exception {
77
83
String fileName = KotlinTestUtils .navigationMetadata ("idea/testData/editor/quickDoc/JavaClassUsedInKotlin.kt" );
You can’t perform that action at this time.
0 commit comments