mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 22:10:13 +01:00
Remove trimLeft/trimRight helpers; use native implementations.
This commit is contained in:
parent
22c36c388f
commit
73511ff677
4 changed files with 7 additions and 46 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const { addErrorContext, filterTokens, rangeFromRegExp, trimLeft, trimRight } =
|
||||
const { addErrorContext, filterTokens, rangeFromRegExp } =
|
||||
require("../helpers");
|
||||
|
||||
const spaceInLinkRe = /\[(?:\s+(?:[^\]]*?)\s*|(?:[^\]]*?)\s+)](?=\(\S*\))/;
|
||||
|
|
@ -21,8 +21,8 @@ module.exports = {
|
|||
linkText = "";
|
||||
} else if (child.type === "link_close") {
|
||||
inLink = false;
|
||||
const left = trimLeft(linkText).length !== linkText.length;
|
||||
const right = trimRight(linkText).length !== linkText.length;
|
||||
const left = linkText.trimLeft().length !== linkText.length;
|
||||
const right = linkText.trimRight().length !== linkText.length;
|
||||
if (left || right) {
|
||||
addErrorContext(onError, token.lineNumber,
|
||||
"[" + linkText + "]", left, right,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue