Skip to content

Commit

Permalink
[23] Issue with code fence > 3 in markdown comment (#1670)
Browse files Browse the repository at this point in the history
Test case for eclipse-jdt/eclipse.jdt.core#3006
 Also by: Stephan Herrmann <stephan.herrmann@berlin.de>
  • Loading branch information
jarthana authored Oct 1, 2024
1 parent 18d7b89 commit fd6cb03
Showing 1 changed file with 59 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -899,4 +899,63 @@ <p>This is a test Javadoc for method test4()
""";
assertHtmlContent(expectedContent, actualHtmlContent);
}
@Test
public void testFenceLenFour_1() throws CoreException {
String source= """
/// ````
/// ```
/// @param is not a tag here because this is nested literal *markdown*
/// ```
/// ````
public class FenceLenFour {
}
""";
ICompilationUnit cu= getWorkingCopy("/TestSetupProject/src/p/FenceLenFour.java", source, null);
assertNotNull("FenceLenFour.java", cu);

String expectedContent= """
<pre><code>```
@param is not a tag here because this is nested literal *markdown*
```
</code></pre>
""";
IType type= cu.getType("FenceLenFour");
String actualHtmlContent= getHoverHtmlContent(cu, type);
assertHtmlContent(expectedContent, actualHtmlContent);
}
@Test
public void testFenceLenFour_2() throws CoreException {
String source= """
public class FenceLenFour {
/// `````
/// ````
/// ```
/// @param is not a tag here because this is nested literal *markdown*
/// ```
/// ````
/// `````
/// @return an int value
/// @param i real param
public int foo(int i) {
return 0;
}
}
""";
ICompilationUnit cu= getWorkingCopy("/TestSetupProject/src/p/FenceLenFour.java", source, null);
assertNotNull("FenceLenFour.java", cu);

String expectedContent= """
<pre><code>````
```
@param is not a tag here because this is nested literal *markdown*
```
````
</code></pre>
<dl><dt>Parameters:</dt><dd><b>i</b> real param</dd><dt>Returns:</dt><dd>an int value</dd></dl>
""";
IType type= cu.getType("FenceLenFour");
IMethod method= type.getMethods()[0];
String actualHtmlContent= getHoverHtmlContent(cu, method);
assertHtmlContent(expectedContent, actualHtmlContent);
}
}

0 comments on commit fd6cb03

Please sign in to comment.