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 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));
}
}
});