2018-01-21 21:44:25 -08:00
|
|
|
// @ts-check
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
2018-04-27 22:05:34 -07:00
|
|
|
const shared = require("./shared");
|
2018-01-21 21:44:25 -08:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
"names": [ "MD035", "hr-style" ],
|
|
|
|
"description": "Horizontal rule style",
|
|
|
|
"tags": [ "hr" ],
|
|
|
|
"function": function MD035(params, onError) {
|
2018-04-27 22:05:34 -07:00
|
|
|
let style = params.config.style || "consistent";
|
2018-01-21 21:44:25 -08:00
|
|
|
shared.filterTokens(params, "hr", function forToken(token) {
|
2018-04-27 22:05:34 -07:00
|
|
|
const lineTrim = token.line.trim();
|
2018-01-21 21:44:25 -08:00
|
|
|
if (style === "consistent") {
|
|
|
|
style = lineTrim;
|
|
|
|
}
|
|
|
|
shared.addErrorDetailIf(onError, token.lineNumber, style, lineTrim);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|