Add MD035 with tests.

This commit is contained in:
David Anson 2015-04-14 09:40:16 -07:00
parent 9acbb2750e
commit 762d8425ca
12 changed files with 166 additions and 3 deletions

View file

@ -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);
}
});
}
}
];