-
Bug
-
Resolution: Fixed
-
P4
-
20
-
b26
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
For example when a p tag is nested within an a tag, Javadoc incorrectly gives this error.
The content model of the a tag is "transparent" (with some specific restrictions, see [1]).
I don't know whether Javadoc fully implements all the content models [2] and their rules, but it should err on the side of caution and not give errors on valid HTML5 content.
[1] https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-a-element
[2] https://html.spec.whatwg.org/multipage/dom.html#content-models
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create `Foo.java` as below and run `javadoc Foo.java`.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
No errors
ACTUAL -
Foo.java:5: error: block element not allowed within inline element <a>: p
<p>A whole paragraph
^
---------- BEGIN SOURCE ----------
/**
Sentence.
<a href="https://foo.bar">
<p>A whole paragraph
that is clickable.</p>
</a>
*/
public class Foo {}
---------- END SOURCE ----------
For example when a p tag is nested within an a tag, Javadoc incorrectly gives this error.
The content model of the a tag is "transparent" (with some specific restrictions, see [1]).
I don't know whether Javadoc fully implements all the content models [2] and their rules, but it should err on the side of caution and not give errors on valid HTML5 content.
[1] https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-a-element
[2] https://html.spec.whatwg.org/multipage/dom.html#content-models
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create `Foo.java` as below and run `javadoc Foo.java`.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
No errors
ACTUAL -
Foo.java:5: error: block element not allowed within inline element <a>: p
<p>A whole paragraph
^
---------- BEGIN SOURCE ----------
/**
Sentence.
<a href="https://foo.bar">
<p>A whole paragraph
that is clickable.</p>
</a>
*/
public class Foo {}
---------- END SOURCE ----------