有没有办法在 IntelliJ IDEA 的文档注释中临时呈现 HTML 标记?我希望能够做到这一点,因为它使阅读一些文档更容易。例如,考虑 jUnit 源代码中的以下片段:
/**
* The <code>Test</code> annotation tells JUnit that the <code>public void</code> method
* ...
* ...
* <p>
* A simple test looks like this:
* <pre>
* public class Example {
* <b>@Test</b>
* public void method() {
* org.junit.Assert.assertTrue( new ArrayList().isEmpty() );
* }
* }
* </pre>
* <p>
* The <code>Test</code> annotation supports two optional parameters.
* The first, <code>expected</code>, declares that a test method should throw
* ...
* ...
* <pre>
* @Test(<b>expected=IndexOutOfBoundsException.class</b>) public void outOfBounds() {
* new ArrayList<Object>().get(1);
* }
* </pre></p>
* <p>
* The second optional parameter, <code>timeout</code>, causes a test to fail if it takes
* longer than a specified amount of clock time (measured in milliseconds). The following test fails:
* <pre>
* @Test(<b>timeout=100</b>) public void infinity() {
* while(true);
* }
* </pre>
* <b>Warning</b>: while <code>timeout</code> is useful to catch and terminate
* infinite loops, it should <em>not</em> be considered deterministic. The
* ...
* ...
* <pre>
* @Test(<b>timeout=100</b>) public void sleep100() {
* Thread.sleep(100);
* }
* </pre>
*
*
* @since 4.0
*/
所有的标记,更不用说 HTML 编码,使得解析文档有点困难。
我试图寻找一种方法来做到这一点,但没有任何有意义的事情出现。也许我没有使用正确的关键字?