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:
Milos Levacic 2018-03-19 23:39:42 +01:00
parent f80b61d8b7
commit d249888ed2
148 changed files with 861 additions and 699 deletions

View file

@ -4,12 +4,12 @@
var shared = require("./shared");
var atxClosedHeaderSpaceRe = /(?:^#+\s\s+?\S)|(?:\S\s\s+?#+\s*$)/;
var atxClosedHeadingSpaceRe = /(?:^#+\s\s+?\S)|(?:\S\s\s+?#+\s*$)/;
module.exports = {
"names": [ "MD021", "no-multiple-space-closed-atx" ],
"description": "Multiple spaces inside hashes on closed atx style header",
"tags": [ "headers", "atx_closed", "spaces" ],
"description": "Multiple spaces inside hashes on closed atx style heading",
"tags": [ "headings", "headers", "atx_closed", "spaces" ],
"function": function MD021(params, onError) {
shared.filterTokens(params, "heading_open", function forToken(token) {
if (shared.headingStyleFor(token) === "atx_closed") {
@ -18,7 +18,7 @@ module.exports = {
if (left || right) {
shared.addErrorContext(onError, token.lineNumber, token.line.trim(),
left, right,
shared.rangeFromRegExp(token.line, atxClosedHeaderSpaceRe));
shared.rangeFromRegExp(token.line, atxClosedHeadingSpaceRe));
}
}
});