From 55cd32bfaf9ed5bc5418751369e46fa1d7f098e8 Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Mon, 6 Jan 2014 10:50:22 -0800 Subject: Moves rule files to src/ --- guidelines/wikipedia/src/imageAlt.js | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 guidelines/wikipedia/src/imageAlt.js (limited to 'guidelines/wikipedia/src/imageAlt.js') diff --git a/guidelines/wikipedia/src/imageAlt.js b/guidelines/wikipedia/src/imageAlt.js new file mode 100644 index 0000000..c54244d --- /dev/null +++ b/guidelines/wikipedia/src/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); + }); +}; -- cgit v1.2.3