mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Add MD001 with test, refactor to remove common code.
This commit is contained in:
parent
82caaa9407
commit
75b63a43ab
3 changed files with 43 additions and 19 deletions
|
@ -21,7 +21,8 @@ function lintFile(file, options, callback) {
|
|||
var lines = contents.split(/\r\n|\r|\n/g);
|
||||
var result = {};
|
||||
rules.forEach(function forRule(rule) {
|
||||
var errors = rule.func(tokens, lines);
|
||||
var errors = [];
|
||||
rule.func(errors, tokens, lines);
|
||||
if (errors.length) {
|
||||
errors.sort(numberComparison);
|
||||
result[rule.name] = errors.filter(uniqueFilterForSorted);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue