mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-21 16:30:12 +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/md027.js
10
lib/md027.js
|
|
@ -2,17 +2,17 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var shared = require("./shared");
|
||||
const shared = require("./shared");
|
||||
|
||||
var spaceAfterBlockQuote = /^\s*(?:>\s+)+\S/;
|
||||
const spaceAfterBlockQuote = /^\s*(?:>\s+)+\S/;
|
||||
|
||||
module.exports = {
|
||||
"names": [ "MD027", "no-multiple-space-blockquote" ],
|
||||
"description": "Multiple spaces after blockquote symbol",
|
||||
"tags": [ "blockquote", "whitespace", "indentation" ],
|
||||
"function": function MD027(params, onError) {
|
||||
var blockquoteNesting = 0;
|
||||
var listItemNesting = 0;
|
||||
let blockquoteNesting = 0;
|
||||
let listItemNesting = 0;
|
||||
params.tokens.forEach(function forToken(token) {
|
||||
if (token.type === "blockquote_open") {
|
||||
blockquoteNesting++;
|
||||
|
|
@ -23,7 +23,7 @@ module.exports = {
|
|||
} else if (token.type === "list_item_close") {
|
||||
listItemNesting--;
|
||||
} else if ((token.type === "inline") && (blockquoteNesting > 0)) {
|
||||
var multipleSpaces = listItemNesting ?
|
||||
const multipleSpaces = listItemNesting ?
|
||||
/^(\s*>)+\s\s+>/.test(token.line) :
|
||||
/^(\s*>)+\s\s/.test(token.line);
|
||||
if (multipleSpaces) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue