From 280b590ead6b3c92f465e3fb98a7d045fcaee545 Mon Sep 17 00:00:00 2001 From: Baratali Izmailov Date: Thu, 9 Jun 2016 11:33:47 +0100 Subject: [PATCH] Issue #410: Some amendments in WritingJavadocCheck, HTML tags part --- src/xdocs/writingjavadocchecks.xml.vm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/xdocs/writingjavadocchecks.xml.vm b/src/xdocs/writingjavadocchecks.xml.vm index aa3a21670..80f89a863 100644 --- a/src/xdocs/writingjavadocchecks.xml.vm +++ b/src/xdocs/writingjavadocchecks.xml.vm @@ -53,10 +53,10 @@ public class MyClass { Checkstyle can not parse something that looks like an HTML, so limitation appear.

- 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.

- 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.
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: all HTML4 elements.

- 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 empty html tags, for example BR tag). + HTML 4 is picked just to have a list of elements whose end tag is optional and a list of void elements (also known as empty html tags, for example BR tag).

- HTML tags with "don't require closing tag" tag: <P>, <LI>, <TR>, <TD>, <TH>, <BODY>, <COLGROUP>, <DD>, + HTML elements whose end tag is optional: <P>, <LI>, <TR>, <TD>, <TH>, <BODY>, <COLGROUP>, <DD>, <DT>, <HEAD>, <HTML>, <OPTION>, <TBODY>, <THEAD>, <TFOOT>.

- Empty HTML tags: <AREA>, <BASE>, <BASEFONT>, <BR>, <COL>, <FRAME>, + Void HTML elements: <AREA>, <BASE>, <BASEFONT>, <BR>, <COL>, <FRAME>, <HR>, <IMG>, <INPUT>, <ISINDEX>, <LINK>, <META>, <PARAM>.