Description

Images included in pages will be rendered in HTML without the attribute alt to the element IMG. Because this attribute is obligatory since HTML-4.0, validation of pages containing images will fail.

Example

Any page with graphics included inline—just click on the "Valid HTML" link in the bottom line.

E.g. MoinMoinBugs/LogoHasSharpEdges results to This page is not Valid HTML 4.01 Strict! - Required attribute "ALT" not specified on http://validator.w3.org/check?uri=http%3A%2F%2Fmoinmoin.wikiwikiweb.de%2FMoinMoinBugs%2FLogoHasSharpEdges

because the wiki source code

attachment:image.png
inline:image.png

is rendered as

<img class="attachment" src="/PagePath?action=AttachFile&amp;do=get&amp;target=image.png" title="attachment:image.png" />

Details

This wiki.

MoinMoin Version

1.5.7 [Revision release]

Python Version

2.5 (r25:51908, Oct 9 2006, 19:27:13) [GCC 3.3.5 (Debian 1:3.3.5-13)]

Workaround

None.

Discussion

I first thought about filing this issue as a FeatureRequest, but as it produces broken HTML, it qualifies as a bug, IMHO. (Which also means this is not just an accessibility concern.)

A good solution for this issue would allow users to specify an alt text during file upload (or within the page). However, we need a default value, in case the user omits the alt text.

Thus, I suggest to include the filename (the basename?) as the value for the alt attribute, and drop the title attribute instead. This works as a default value in case the user omits the alt text, and as an intermediate solution until the ability for such an alt attribute is implemented, both. I'm aware that the filename is not necessarily a good or even a valid value for the alt attribute, but given the need for i) a default value and ii) an intermediate solution, I think this is the best thing we can offer.

Maybe the (optional) title attribute, which works like this, was implemented by mistaking it for the (obligatory) alt attribute?

Plan


CategoryMoinMoinBugFixed

MoinMoin: MoinMoinBugs/ImgMissesAltAttribute (last edited 2007-10-29 19:21:13 by localhost)