diff --git a/java/java-impl/src/com/intellij/codeInsight/javadoc/JavaDocInfoGenerator.java b/java/java-impl/src/com/intellij/codeInsight/javadoc/JavaDocInfoGenerator.java index 63d903b9df57..3c94d5681a05 100644 --- a/java/java-impl/src/com/intellij/codeInsight/javadoc/JavaDocInfoGenerator.java +++ b/java/java-impl/src/com/intellij/codeInsight/javadoc/JavaDocInfoGenerator.java @@ -2320,7 +2320,7 @@ public class JavaDocInfoGenerator { PsiElement label = referenceLink.getLabel(); String referenceText = reference != null ? reference.getText() : ""; - String labelText = label != null ? label.getText() : ""; + String labelText = label instanceof PsiMarkdownReferenceLabel ? label.getText() : null; // JEP 467 requires reference brackets to be escaped, remove the escape to match the reference referenceText = referenceText.replace("\\[", "[").replace("\\]", "]"); diff --git a/java/java-tests/testData/codeInsight/javadocIG/allTagsMarkdown.html b/java/java-tests/testData/codeInsight/javadocIG/allTagsMarkdown.html index d71078de70ad..a73a2e11690d 100644 --- a/java/java-tests/testData/codeInsight/javadocIG/allTagsMarkdown.html +++ b/java/java-tests/testData/codeInsight/javadocIG/allTagsMarkdown.html @@ -3,9 +3,9 @@ Returns calculated result.
Math.E
<T>
- Math#E
+ Math.E
Euler constant
calculation
java.version
2.718281828459045

 return a + b;
-

Deprecated

use Math#addExact

Params:

a – first parameter
b – second parameter

Type parameters:

<T> – type parameter

Returns:

sum result

Throws:

ArithmeticException – overflow

IllegalArgumentException – invalid input

Since:

1.0

Version:

2.0

Author:

John Doe

See Also:

Math.E

spec

link spec

provides

Math

uses

Math

hidden

\ No newline at end of file +

Deprecated

use Math.addExact

Params:

a – first parameter
b – second parameter

Type parameters:

<T> – type parameter

Returns:

sum result

Throws:

ArithmeticException – overflow

IllegalArgumentException – invalid input

Since:

1.0

Version:

2.0

Author:

John Doe

See Also:

Math.E

spec

link spec

provides

Math

uses

Math

hidden

\ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/javadocIG/linkInParamDescriptionMarkdown.html b/java/java-tests/testData/codeInsight/javadocIG/linkInParamDescriptionMarkdown.html index c95f3407a425..2f469837ff23 100644 --- a/java/java-tests/testData/codeInsight/javadocIG/linkInParamDescriptionMarkdown.html +++ b/java/java-tests/testData/codeInsight/javadocIG/linkInParamDescriptionMarkdown.html @@ -1,2 +1,2 @@
 Test
int foo(
int a, - int b
)

Params:

a – link to java.lang.String
b – link with a label

Returns:

return label with a link java.lang.String

\ No newline at end of file + int b
)

Params:

a – link to String
b – link with a label

Returns:

return label with a link String

\ No newline at end of file