mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 14:30:12 +01:00
19 lines
584 B
JavaScript
19 lines
584 B
JavaScript
// @ts-check
|
|
|
|
"use strict";
|
|
|
|
var shared = require("./shared");
|
|
|
|
module.exports = {
|
|
"names": [ "MD018", "no-missing-space-atx" ],
|
|
"description": "No space after hash on atx style header",
|
|
"tags": [ "headers", "atx", "spaces" ],
|
|
"function": function MD018(params, onError) {
|
|
shared.forEachLine(function forLine(line, lineIndex, inCode) {
|
|
if (!inCode && /^#+[^#\s]/.test(line) && !/#$/.test(line)) {
|
|
shared.addErrorContext(onError, lineIndex + 1, line.trim(), null,
|
|
null, shared.rangeFromRegExp(line, shared.atxHeaderSpaceRe));
|
|
}
|
|
});
|
|
}
|
|
};
|