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/md036.js
10
lib/md036.js
|
|
@ -2,21 +2,21 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var shared = require("./shared");
|
||||
const shared = require("./shared");
|
||||
|
||||
module.exports = {
|
||||
"names": [ "MD036", "no-emphasis-as-heading", "no-emphasis-as-header" ],
|
||||
"description": "Emphasis used instead of a heading",
|
||||
"tags": [ "headings", "headers", "emphasis" ],
|
||||
"function": function MD036(params, onError) {
|
||||
var punctuation = params.config.punctuation || ".,;:!?";
|
||||
var re = new RegExp("[" + punctuation + "]$");
|
||||
const punctuation = params.config.punctuation || ".,;:!?";
|
||||
const re = new RegExp("[" + punctuation + "]$");
|
||||
function base(token) {
|
||||
if (token.type === "paragraph_open") {
|
||||
return function inParagraph(t) {
|
||||
// Always paragraph_open/inline/paragraph_close,
|
||||
// omit (t.type === "inline")
|
||||
var children = t.children.filter(function notEmptyText(child) {
|
||||
const children = t.children.filter(function notEmptyText(child) {
|
||||
return (child.type !== "text") || (child.content !== "");
|
||||
});
|
||||
if ((children.length === 3) &&
|
||||
|
|
@ -46,7 +46,7 @@ module.exports = {
|
|||
}
|
||||
return base;
|
||||
}
|
||||
var state = base;
|
||||
let state = base;
|
||||
params.tokens.forEach(function forToken(token) {
|
||||
state = state(token);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue