mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 06:20:12 +01:00
Change "header" to "heading" across the library
This should be backward compatible, as all "header" aliases are still available, though documented as discouraged for future use.
This commit is contained in:
parent
e938f421a9
commit
45424cf459
148 changed files with 861 additions and 699 deletions
|
|
@ -4,12 +4,12 @@
|
|||
|
||||
var shared = require("./shared");
|
||||
|
||||
var atxClosedHeaderNoSpaceRe = /(?:^#+[^#\s])|(?:[^#\s]#+\s*$)/;
|
||||
var atxClosedHeadingNoSpaceRe = /(?:^#+[^#\s])|(?:[^#\s]#+\s*$)/;
|
||||
|
||||
module.exports = {
|
||||
"names": [ "MD020", "no-missing-space-closed-atx" ],
|
||||
"description": "No space inside hashes on closed atx style header",
|
||||
"tags": [ "headers", "atx_closed", "spaces" ],
|
||||
"description": "No space inside hashes on closed atx style heading",
|
||||
"tags": [ "headings", "headers", "atx_closed", "spaces" ],
|
||||
"function": function MD020(params, onError) {
|
||||
shared.forEachLine(function forLine(line, lineIndex, inCode) {
|
||||
if (!inCode && /^#+[^#]*[^\\]#+$/.test(line)) {
|
||||
|
|
@ -17,7 +17,7 @@ module.exports = {
|
|||
var right = /[^#\s]#+$/.test(line);
|
||||
if (left || right) {
|
||||
shared.addErrorContext(onError, lineIndex + 1, line.trim(), left,
|
||||
right, shared.rangeFromRegExp(line, atxClosedHeaderNoSpaceRe));
|
||||
right, shared.rangeFromRegExp(line, atxClosedHeadingNoSpaceRe));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue