mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Add MD035 with tests.
This commit is contained in:
parent
9acbb2750e
commit
762d8425ca
12 changed files with 166 additions and 3 deletions
18
lib/rules.js
18
lib/rules.js
|
@ -649,5 +649,23 @@ module.exports = [
|
|||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"name": "MD035",
|
||||
"desc": "Horizontal rule style",
|
||||
"tags": [ "hr" ],
|
||||
"func": function MD035(params, errors) {
|
||||
var style = params.options.style || "consistent";
|
||||
var horizontalRules = filterTokens(params.tokens, "hr");
|
||||
if ((style === "consistent") && horizontalRules.length) {
|
||||
style = horizontalRules[0].line;
|
||||
}
|
||||
horizontalRules.forEach(function forToken(token) {
|
||||
if (token.line !== style) {
|
||||
errors.push(token.lineNumber);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue