mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 06:20:12 +01:00
Fix bug in detailed error message for MD030/list-marker-space when no space present (fixes #57).
This commit is contained in:
parent
942f0600d2
commit
da529ac286
3 changed files with 52 additions and 1 deletions
|
|
@ -758,7 +758,7 @@ module.exports = [
|
||||||
list.items.forEach(function forItem(item) {
|
list.items.forEach(function forItem(item) {
|
||||||
var match = /^[\s>]*\S+(\s+)/.exec(item.line);
|
var match = /^[\s>]*\S+(\s+)/.exec(item.line);
|
||||||
errors.addDetailIf(item.lineNumber,
|
errors.addDetailIf(item.lineNumber,
|
||||||
expectedSpaces, !match || match[1].length);
|
expectedSpaces, (match ? match[1].length : 0));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
13
test/detailed-results-MD030-warning-message.md
Normal file
13
test/detailed-results-MD030-warning-message.md
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
#
|
||||||
|
|
||||||
|
-
|
||||||
|
|
||||||
|
1.
|
||||||
|
|
||||||
|
- a
|
||||||
|
|
||||||
|
1. a
|
||||||
|
|
||||||
|
- a
|
||||||
|
|
||||||
|
1. a
|
||||||
38
test/detailed-results-MD030-warning-message.results.json
Normal file
38
test/detailed-results-MD030-warning-message.results.json
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"lineNumber": 3,
|
||||||
|
"ruleName": "MD030",
|
||||||
|
"ruleAlias": "list-marker-space",
|
||||||
|
"ruleDescription": "Spaces after list markers",
|
||||||
|
"errorDetail": "Expected: 1; Actual: 0",
|
||||||
|
"errorContext": null,
|
||||||
|
"errorRange": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"lineNumber": 5,
|
||||||
|
"ruleName": "MD030",
|
||||||
|
"ruleAlias": "list-marker-space",
|
||||||
|
"ruleDescription": "Spaces after list markers",
|
||||||
|
"errorDetail": "Expected: 1; Actual: 0",
|
||||||
|
"errorContext": null,
|
||||||
|
"errorRange": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"lineNumber": 11,
|
||||||
|
"ruleName": "MD030",
|
||||||
|
"ruleAlias": "list-marker-space",
|
||||||
|
"ruleDescription": "Spaces after list markers",
|
||||||
|
"errorDetail": "Expected: 1; Actual: 2",
|
||||||
|
"errorContext": null,
|
||||||
|
"errorRange": [1, 3]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"lineNumber": 13,
|
||||||
|
"ruleName": "MD030",
|
||||||
|
"ruleAlias": "list-marker-space",
|
||||||
|
"ruleDescription": "Spaces after list markers",
|
||||||
|
"errorDetail": "Expected: 1; Actual: 2",
|
||||||
|
"errorContext": null,
|
||||||
|
"errorRange": [1, 4]
|
||||||
|
}
|
||||||
|
]
|
||||||
Loading…
Add table
Add a link
Reference in a new issue