Issue #410: Some amendments in WritingJavadocCheck, HTML tags part

This commit is contained in:
Baratali Izmailov 2016-06-09 11:33:47 +01:00 committed by Roman Ivanov
parent ae254f7949
commit 280b590ead
1 changed files with 5 additions and 5 deletions

View File

@ -53,10 +53,10 @@ public class MyClass {
Checkstyle can not parse something that looks like an HTML, so limitation appear.
</p>
<p>
The comment should be written in XHTML to build nested AST Tree that most Checks expect. This means that every HTML tag should have matching closed HTML tag or it is self-closed tag.
The comment should be written in XHTML to build nested AST Tree that most Checks expect. This means that every HTML tag should have matching end HTML tag or it is a void tag.
</p>
<p>
The only exceptions are HTML 4 tags that are "don't require closing" tag, so, Checkstyle won't show error about missing closing tag, however, it leads to broken XHTML structure and as result leads to
The only exceptions are HTML 4 tags whose end tag is optional, so, Checkstyle won't show error about missing end tag, however, it leads to broken XHTML structure and as result leads to
not-nested content of the HTML tags in Abstract Syntax Tree of the Javadoc comment.
<br/>
In other words if HTML tags are not closed Javadoc grammar cannot determine content of these tags,
@ -267,14 +267,14 @@ class MyCheck extends AbstractJavadocCheck {
Checkstyle supports HTML4 tags in Javadoc comments: <a href="https://www.w3.org/TR/html4/index/elements.html">all HTML4 elements</a>.
</p>
<p>
HTML 4 is picked just to have a list of tags that are "don't require closing tag" and a list of tags whose end tag is forbidden (also known as <a href="http://www.w3schools.com/html/html_elements.asp">empty html tags</a>, for example <a href="https://www.w3.org/TR/html4/struct/text.html#edef-BR">BR tag</a>).
HTML 4 is picked just to have a list of elements whose end tag is optional and a list of <a href="https://www.w3.org/TR/html-markup/syntax.html#void-element">void elements</a> (also known as <a href="http://www.w3schools.com/html/html_elements.asp">empty html tags</a>, for example <a href="https://www.w3.org/TR/html4/struct/text.html#edef-BR">BR tag</a>).
</p>
<p>
HTML tags with "don't require closing tag" tag: &lt;P&gt;, &lt;LI&gt;, &lt;TR&gt;, &lt;TD&gt;, &lt;TH&gt;, &lt;BODY&gt;, &lt;COLGROUP&gt;, &lt;DD&gt;,
HTML elements whose end tag is optional: &lt;P&gt;, &lt;LI&gt;, &lt;TR&gt;, &lt;TD&gt;, &lt;TH&gt;, &lt;BODY&gt;, &lt;COLGROUP&gt;, &lt;DD&gt;,
&lt;DT&gt;, &lt;HEAD&gt;, &lt;HTML&gt;, &lt;OPTION&gt;, &lt;TBODY&gt;, &lt;THEAD&gt;, &lt;TFOOT&gt;.
</p>
<p>
Empty HTML tags: &lt;AREA&gt;, &lt;BASE&gt;, &lt;BASEFONT&gt;, &lt;BR&gt;, &lt;COL&gt;, &lt;FRAME&gt;,
Void HTML elements: &lt;AREA&gt;, &lt;BASE&gt;, &lt;BASEFONT&gt;, &lt;BR&gt;, &lt;COL&gt;, &lt;FRAME&gt;,
&lt;HR&gt;, &lt;IMG&gt;, &lt;INPUT&gt;, &lt;ISINDEX&gt;, &lt;LINK&gt;, &lt;META&gt;, &lt;PARAM&gt;.
</p>
<p>