mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Remove state from shared.js, move to cache.js.
This commit is contained in:
parent
827e1acb56
commit
f614f3e1ce
17 changed files with 124 additions and 98 deletions
|
@ -2,9 +2,9 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const shared = require("./shared");
|
||||
const { addErrorDetailIf, filterTokens, forEachHeading, forEachLine,
|
||||
includesSorted, rangeFromRegExp } = shared;
|
||||
includesSorted, rangeFromRegExp } = require("./shared");
|
||||
const { lineMetadata } = require("./cache");
|
||||
|
||||
const longLineRePrefix = "^(.{";
|
||||
const longLineRePostfix = "})(.*\\s.*)$";
|
||||
|
@ -56,7 +56,7 @@ module.exports = {
|
|||
linkOnlyLineNumbers.push(token.lineNumber);
|
||||
}
|
||||
});
|
||||
forEachLine((line, lineIndex, inCode, onFence, inTable) => {
|
||||
forEachLine(lineMetadata(), (line, lineIndex, inCode, onFence, inTable) => {
|
||||
const lineNumber = lineIndex + 1;
|
||||
const isHeading = includesSorted(headingLineNumbers, lineNumber);
|
||||
const length = isHeading ? headingLineLength : lineLength;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue