Tidy 30

From Htmlpedia
Jump to: navigation, search

Tidy: Expecting -- or >

Cause:

A comment contains mismatched double dashes.

Example:

Bad<!-- King John II of France -- nicknamed the Good -- died in captivity in London. -->
Good<!-- King John II of France -nicknamed the Good- died in captivity in London. -->
Good<!-- King John II of France ---- nicknamed the Good ---- died in captivity in London. -->
Good<!>

The latter is an example of an "empty comment", which is valid though rarely used.

Solution:

Make sure that the text between <! and > consists only of zero or more parts bounded by double dashes, separated only by whitespace, that each double dash has text on one side only, and that the opening <! of a comment is followed immediately by the first double dash (or by the closing > ).
It's recommended to avoid any double dash between <!-- and -->.

References:

HTML comments are SGML comments, see ISO/IEC 8879:1986