Re: Tidy converts "--" in comments...

On Feb 28, 2010, at 5:47 AM, Dennis Kowallek wrote:

> I am running tidy.exe for windows dated 22 March 2008.
>
> I have "fix-bad-comments: no" in the cfg file. But tidy converts  
> "--" in
> comments to "-=".
>
> I would like tidy to leave these alone. What am I doing wrong?

SGML and XML comments simply are not allowed to contain "--".
If you leave those bad comments alone, then many XML parsers
*will* break.  Tidy is telling you about a serious foulup in
your data and trying to help you.

<SGML Comment> ::=
     "<!" ("--"([-]?[^-])*"--" sp*)* ">"
     E.g., <!>, <!--a-b-c--> <!--a-b--  --c-d-e--  --f-g--  >

<XML Comment> ::=
     "<!--" ([-]?[^-])* "-->"
     E.g., <!--a-b-c-->

<!--------> *is* an SGML comment, as is anything with exactly
4n dashes between the "<!" and the ">", because it's actually
n comment segments.  But it is not an XML comment, and
<!-------> is *not* an SGML comment (7 not being a multiple of 4).
XML comments may only have one segment, which means no "--" *ever*
between "<!--" and "-->".

Received on Monday, 1 March 2010 00:56:01 UTC