@Code tag doesn't always get reformatted
jhameier opened this issue · 4 comments
jhameier commented
I noticed when running the formatter over a doc with slightly different code blocks that some appear to get formatted with <code>
tags and others do not.
The driver:
import com.github.therapi.runtimejavadoc.ClassJavadoc;
import com.github.therapi.runtimejavadoc.CommentFormatter;
import com.github.therapi.runtimejavadoc.MethodJavadoc;
import com.github.therapi.runtimejavadoc.RuntimeJavadoc;
public class Driver {
public static void main(String[] args) {
ClassJavadoc javadoc = RuntimeJavadoc.getJavadoc(Test.class);
MethodJavadoc methodJavadoc = javadoc.getMethods().get(0);
String format = new CommentFormatter().format(methodJavadoc.getComment());
System.out.println(format);
}
}
The Test file:
public class Test {
/**
* <pre>{@code
* <Class>
* <Load>ask</Load>
* <ConstructArg>
* <ArgName>facilities</ArgName>
* <ArgType>java.lang.String</ArgType>
* <ArgValue>ZDC,ZOB,ZNY</ArgValue>
* </ConstructArg>
* </Class>
* }</pre>
*
* <pre>{@code
* echo 'net.ipv4.igmp_max_memberships=1024' > /usr/lib/sysctl.d/51-adsb.conf
* }</pre>
*/
public void testMethod() {}
}
The output:
<pre>{@code
<Class>
<Load>ask</Load>
<ConstructArg>
<ArgName>facilities</ArgName>
<ArgType>java.lang.String</ArgType>
<ArgValue>ZDC,ZOB,ZNY</ArgValue>
</ConstructArg>
</Class>
}</pre>
<pre><code>echo 'net.ipv4.igmp_max_memberships=1024' > /usr/lib/sysctl.d/51-adsb.conf
</code></pre>
jhameier commented
dnault commented
Regarding the aside, the JsonObject
class marked in red is part of the Minimal-Json library that is bundled and repackaged with the reader. The Gradle "shadow" plugin is relocating the dependency classes, but doesn't update the sources. See GradleUp/shadow#41
Not much we can do about that, short of switching to Maven or undertaking the huge effort of enhancing the shadow plugin.