mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00

This should be backward compatible, as all "header" aliases are still available, though documented as discouraged for future use.
21 lines
667 B
JavaScript
21 lines
667 B
JavaScript
// @ts-check
|
|
|
|
"use strict";
|
|
|
|
var shared = require("./shared");
|
|
|
|
module.exports = {
|
|
"names": [ "MD019", "no-multiple-space-atx" ],
|
|
"description": "Multiple spaces after hash on atx style heading",
|
|
"tags": [ "headings", "headers", "atx", "spaces" ],
|
|
"function": function MD019(params, onError) {
|
|
shared.filterTokens(params, "heading_open", function forToken(token) {
|
|
if ((shared.headingStyleFor(token) === "atx") &&
|
|
/^#+\s\s/.test(token.line)) {
|
|
shared.addErrorContext(onError, token.lineNumber, token.line.trim(),
|
|
null, null,
|
|
shared.rangeFromRegExp(token.line, shared.atxHeadingSpaceRe));
|
|
}
|
|
});
|
|
}
|
|
};
|