1
votes

I would like to use <sub> and <sup> in JavaDoc for a better formatting. However, it seems that JavaDoc is struggling with those elements. At least the maven-javadoc-plugin floods with such warning messages. Java 11 should support <sub> and <sup> anyway. It seems it doesn't like <sub> within <pre>element.

Here an example:

[INFO] /knx-link/target/checkout/knx-core/src/main/java/li/pitschmann/knx/core/datapoint/DPT19.java:50: error: tag not allowed here: <sub>
[INFO]  * Format:     8 octets (U<sub>8</sub> [r<sub>4</sub>U<sub>4</sub>] [r<sub>3</sub>U<sub>5</sub>] [r<sub>3</sub>U<sub>5</sub>] [r<sub>2</sub>U<sub>6</sub>] [r<sub>2</sub>U<sub>6</sub>] B<sub>16</sub>)

Before I completely ignore it (as it doesn't prevent me from releasing it) I would like to ask if there is a nice trick available to use elements <sub> and <sup> while text is pre-formatted and is accepted by JavaDoc?

Sidenotes:

  • Java: JDK11
  • Plugin: maven-javadoc-plugin (via maven-release-plugin)

enter image description here

1
Moderator, can you please reopen this question. It should not marked as duplicated because Java 11 supports <sub> and <sup> anyway. Meaning, this question is a completely different one.pitschr

1 Answers

0
votes

Tags <sub> and <sup> are allowed since JDK 9, so you just need to upgrade you JDK and, probably, source level.

Here is the code: http://hg.openjdk.java.net/jdk/jdk/annotate/68adcd2fbc6b/src/jdk.compiler/share/classes/com/sun/tools/doclint/HtmlTag.java#l310