Decimal numeric character references in image's alt attribut

For technical support for all editions of CSE HTML Validator. Includes bug reports.

Decimal numeric character references in image's alt attribut

Postby kennedyrt » Thu Jan 26, 2012 5:31 pm

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 "&amp;". Example: alt="For him & her" should be alt="For him &amp; her". Note that the ampersand was encoded as "&amp;". 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 &amp;#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.
kennedyrt
Rank I - Novice
Rank I - Novice
 
Posts: 15
Joined: Fri Nov 09, 2007 10:57 pm
Location: Renton, Washington

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

Postby Albert Wiersch » Thu Jan 26, 2012 5:46 pm

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?
Image
Albert Wiersch
User avatar
Albert Wiersch
Site Admin
Site Admin
 
Posts: 2361
Joined: Sat Dec 11, 2004 10:23 am
Location: Near Dallas, TX

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

Postby Albert Wiersch » Fri Jan 27, 2012 1:14 pm

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!
Image
Albert Wiersch
User avatar
Albert Wiersch
Site Admin
Site Admin
 
Posts: 2361
Joined: Sat Dec 11, 2004 10:23 am
Location: Near Dallas, TX


Return to CSE Tech Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron