diff options
author | Jesse Hallett <jesse@galois.com> | 2013-12-23 14:02:54 -0800 |
---|---|---|
committer | Jesse Hallett <jesse@galois.com> | 2013-12-23 14:32:47 -0800 |
commit | 62abc5c667896f7af216c4fa6643fc604b8b051f (patch) | |
tree | 4bc548ed9b192a690d498897d9463e98c0a23f17 | |
parent | 43a51d698745361d0ebab7e91439cb4f2806bb1b (diff) |
Wikipedia guideline: images should include an alt attribute
-rw-r--r-- | guidelines/wikipedia/imageAlt.js | 8 | ||||
-rw-r--r-- | guidelines/wikipedia/wikipedia.json | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/guidelines/wikipedia/imageAlt.js b/guidelines/wikipedia/imageAlt.js new file mode 100644 index 0000000..c54244d --- /dev/null +++ b/guidelines/wikipedia/imageAlt.js @@ -0,0 +1,8 @@ +exports.name = "Images should include an alt attribute"; +exports.description = "Images should include an alt attribute, even an empty one, that acts as a substitute for the image (for non-visual users)."; + +exports.rule = function(report) { + $5('#mw-content-text img:not([alt])').each(function(i, img) { + report.warning("Image has no alt attribute.", img); + }); +}; diff --git a/guidelines/wikipedia/wikipedia.json b/guidelines/wikipedia/wikipedia.json index b7b158e..f53febc 100644 --- a/guidelines/wikipedia/wikipedia.json +++ b/guidelines/wikipedia/wikipedia.json @@ -14,5 +14,6 @@ , "pseudoIndent.js" , "floatSandwiches.js" , "spaceBetweenListItems.js" + , "imageAlt.js" ] } |