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,17 +4,17 @@
var shared = require("./shared");
var spaceBeforeHeaderRe = /^\s+\S/;
var spaceBeforeHeadingRe = /^\s+\S/;
module.exports = {
"names": [ "MD023", "header-start-left" ],
"description": "Headers must start at the beginning of the line",
"tags": [ "headers", "spaces" ],
"names": [ "MD023", "heading-start-left", "header-start-left" ],
"description": "Headings must start at the beginning of the line",
"tags": [ "headings", "headers", "spaces" ],
"function": function MD023(params, onError) {
shared.filterTokens(params, "heading_open", function forToken(token) {
if (spaceBeforeHeaderRe.test(token.line)) {
if (spaceBeforeHeadingRe.test(token.line)) {
shared.addErrorContext(onError, token.lineNumber, token.line, null,
null, shared.rangeFromRegExp(token.line, spaceBeforeHeaderRe));
null, shared.rangeFromRegExp(token.line, spaceBeforeHeadingRe));
}
});
}