mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 22:40:13 +01:00
Convert var to const/let (except in browser-only code).
This commit is contained in:
parent
78c1af7bfd
commit
213aef4564
56 changed files with 524 additions and 518 deletions
10
lib/md041.js
10
lib/md041.js
|
|
@ -2,17 +2,17 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var shared = require("./shared");
|
||||
const shared = require("./shared");
|
||||
|
||||
module.exports = {
|
||||
"names": [ "MD041", "first-line-h1" ],
|
||||
"description": "First line in file should be a top level heading",
|
||||
"tags": [ "headings", "headers" ],
|
||||
"function": function MD041(params, onError) {
|
||||
var level = params.config.level || 1;
|
||||
var frontMatterTitle = params.config.front_matter_title;
|
||||
var tag = "h" + level;
|
||||
var frontMatterTitleRe =
|
||||
const level = params.config.level || 1;
|
||||
const frontMatterTitle = params.config.front_matter_title;
|
||||
const tag = "h" + level;
|
||||
const frontMatterTitleRe =
|
||||
new RegExp(frontMatterTitle || "^\\s*title\\s*[:=]", "i");
|
||||
params.tokens.every(function forToken(token, index) {
|
||||
if (token.type === "heading_open") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue