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
|
|
@ -2,16 +2,16 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var shared = require("./shared");
|
||||
const shared = require("./shared");
|
||||
|
||||
module.exports = {
|
||||
"names": [ "MD025", "single-h1" ],
|
||||
"description": "Multiple top level headings in the same document",
|
||||
"tags": [ "headings", "headers" ],
|
||||
"function": function MD025(params, onError) {
|
||||
var level = params.config.level || 1;
|
||||
var tag = "h" + level;
|
||||
var hasTopLevelHeading = false;
|
||||
const level = params.config.level || 1;
|
||||
const tag = "h" + level;
|
||||
let hasTopLevelHeading = false;
|
||||
shared.filterTokens(params, "heading_open", function forToken(token) {
|
||||
if (token.tag === tag) {
|
||||
if (hasTopLevelHeading) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue