mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 22:10: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
14
lib/md037.js
14
lib/md037.js
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var shared = require("./shared");
|
||||
const shared = require("./shared");
|
||||
|
||||
module.exports = {
|
||||
"names": [ "MD037", "no-space-in-emphasis" ],
|
||||
|
|
@ -10,17 +10,17 @@ module.exports = {
|
|||
"tags": [ "whitespace", "emphasis" ],
|
||||
"function": function MD037(params, onError) {
|
||||
shared.forEachInlineChild(params, "text", function forToken(token) {
|
||||
var left = true;
|
||||
var match = /\s(\*\*?|__?)\s.+\1/.exec(token.content);
|
||||
let left = true;
|
||||
let match = /\s(\*\*?|__?)\s.+\1/.exec(token.content);
|
||||
if (!match) {
|
||||
left = false;
|
||||
match = /(\*\*?|__?).+\s\1\s/.exec(token.content);
|
||||
}
|
||||
if (match) {
|
||||
var text = match[0].trim();
|
||||
var line = params.lines[token.lineNumber - 1];
|
||||
var column = line.indexOf(text) + 1;
|
||||
var length = text.length;
|
||||
const text = match[0].trim();
|
||||
const line = params.lines[token.lineNumber - 1];
|
||||
const column = line.indexOf(text) + 1;
|
||||
const length = text.length;
|
||||
shared.addErrorContext(onError, token.lineNumber,
|
||||
text, left, !left, [ column, length ]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue