aboutsummaryrefslogtreecommitdiff
path: root/guidelines/wikipedia/imageAlt.js
diff options
context:
space:
mode:
Diffstat (limited to 'guidelines/wikipedia/imageAlt.js')
-rw-r--r--guidelines/wikipedia/imageAlt.js8
1 files changed, 8 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);
+ });
+};