From ae443f02addef206e88e0a27e5881cfec2d2cff0 Mon Sep 17 00:00:00 2001 From: Duncan Mackenzie Date: Tue, 2 Jan 2018 14:12:34 -0800 Subject: [PATCH] add additional test for reference syntax of images (fixes #75) --- lib/rules.js | 2 +- test/detailed-results-MD041-MD050.md | 4 ++++ test/detailed-results-MD041-MD050.results.json | 11 ++++++++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/lib/rules.js b/lib/rules.js index bdf12bca..4a50eb52 100644 --- a/lib/rules.js +++ b/lib/rules.js @@ -1206,7 +1206,7 @@ module.exports = [ { "name": "MD045", "desc": "Images should have ALT Text attribute", - "tags": [ "images", "accessibility" ], + "tags": [ "accessibility", "images" ], "aliases": [ "no-alt-text" ], "regexp": null, "func": function MD045(params, errors) { diff --git a/test/detailed-results-MD041-MD050.md b/test/detailed-results-MD041-MD050.md index 3139cb8a..ad2911ce 100644 --- a/test/detailed-results-MD041-MD050.md +++ b/test/detailed-results-MD041-MD050.md @@ -19,3 +19,7 @@ A [normal](link) and an [empty one]() and a [fragment](#one). An image without alt text ![](image.jpg) ![](image.jpg) + +A reference image without alt text ![][reference] + +[reference]: image.jpg "title" \ No newline at end of file diff --git a/test/detailed-results-MD041-MD050.results.json b/test/detailed-results-MD041-MD050.results.json index 8a2effec..9558a3d9 100644 --- a/test/detailed-results-MD041-MD050.results.json +++ b/test/detailed-results-MD041-MD050.results.json @@ -45,7 +45,7 @@ "errorRange": [25, 13] }, { - "lineNumber": 22, + "lineNumber": 25, "ruleName": "MD043", "ruleAlias": "required-headers", "ruleDescription": "Required header structure", @@ -97,5 +97,14 @@ "errorDetail": null, "errorContext": null, "errorRange": null + }, + { + "lineNumber": 23, + "ruleName": "MD045", + "ruleAlias": "no-alt-text", + "ruleDescription": "Images should have ALT Text attribute", + "errorDetail": null, + "errorContext": null, + "errorRange": null } ] \ No newline at end of file