Decimal numeric character references in image's alt attribut

For technical support for all editions of CSS HTML Validator. Includes bug reports.
Post Reply
kennedyrt
Rank II - Novice
Rank II - Novice
Posts: 20
Joined: Fri Nov 09, 2007 9:57 pm
Location: Kent, Washington

Decimal numeric character references in image's alt attribut

Post by kennedyrt »

Let's say that I want to use “decimal numeric character references” in the alt attribute of the img tag. As an example, “smart quotes” are “ and ”.

In HTML CSE Validator Pro v11.0032, validate the following code:

<img src="images/work-community_168x112.jpg" alt="Our &#8220;Soaring with Your Dream&#8221; education program" width="168" height="112" />

The result is a the following warning: "[64] An invalid character reference "&" was found in the "alt" attribute value. This may be because the ampersand character was not properly encoded as the entity "&". Example: alt="For him & her" should be alt="For him & her". Note that the ampersand was encoded as "&". Other causes of invalid references are misspelled entity names and missing semicolons.
---"

“Decimal numeric character references” in the alt attribute of the img tag cannot be coded as &#8220; as it appears on the screen as &#8220; rather than a smart quote. “Decimal numeric character references" in the alt attribute of the img tag should not receive the above warning message.

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3494
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Decimal numeric character references in image's alt attr

Post by Albert Wiersch »

Hello,

I cannot reproduce this. The HTML looks fine to me. Can you confirm the error message is really referencing that HTML, and if so, email me a sample document that reproduces the problem?

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3494
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Decimal numeric character references in image's alt attr

Post by Albert Wiersch »

I received the test document and was able to reproduce the problem. It had to do with a bug in the CFML detection and has been fixed for the next update. Thanks for the report!

Post Reply