Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[23] Issue with code fence > 3 in markdown comment #1670

Merged
merged 1 commit into from
Oct 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}
}
Loading