Tidy 3 SE

From Htmlpedia
Jump to: navigation, search

Tidy: oavslutat & eller okänt objekt "&..."

Orsak 1:

Ett et-tecken användes ensamt när objektet "&" borde använts, vilket gör att webläsare tror man refererar till ett objekt som börjar med med vilken bokstav som helst som kommer efter det ensamma "&".

Exempel:

Ofta beror detta på en länk som denna:

Good<a href="http://www.example.com/cgi?x=123&y=456">
Bad<a href="http://www.example.com/cgi?x=123&amp;y=456">

All special characters in HREF should be encoded. "&" is a reserved character that begins an entity. (ex: &nbsp;). "&" in an HREF field should be encoded as its equivalent entity "&amp;", even when used as a separator for parameters in the URL. Before you make an opinion about this, please read this page carefully.

Solution:

Replace "&" with "&amp;".

References:

Cause 2:

You misspelled the name of a character entity (a string beginning with "&").

Example:

Bad&Arin;rhus University
Good&Aring;rhus University

Solution:

Fix the spelling to match one of the names listed in Chapter 24 of the HTML 4 specification.

References:

Cause 3:

(Error message is Tidy: unescaped & or unknown entity "&#...", where ... are digits or "x" followed by hex digits).

Tidy does not always recognize valid numeric character entities.

This is a bug in Tidy and should be ignored.

Example:

This incorrect error occurs in cases such as the following, all 3 examples are correct HTML, tidy is just wrong:

BadJust my &#8364;0.02 (2 Eurocents)
BadJust my &#x20AC;0.02 (2 Eurocents)
GoodJust my $0.02 (2 dollar-cents)

Solution:

Ignore the error message and hope someone fixes the bug in HTML tidy.

References: