mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 22:40:13 +01:00
Cache results of inlineCodeSpanRanges for use by MD011/MD044.
This commit is contained in:
parent
706f48bd25
commit
7d40926367
6 changed files with 56 additions and 39 deletions
31
lib/cache.js
31
lib/cache.js
|
|
@ -2,14 +2,6 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
let lineMetadata = null;
|
||||
module.exports.lineMetadata = (value) => {
|
||||
if (value) {
|
||||
lineMetadata = value;
|
||||
}
|
||||
return lineMetadata;
|
||||
};
|
||||
|
||||
let flattenedLists = null;
|
||||
module.exports.flattenedLists = (value) => {
|
||||
if (value) {
|
||||
|
|
@ -18,7 +10,24 @@ module.exports.flattenedLists = (value) => {
|
|||
return flattenedLists;
|
||||
};
|
||||
|
||||
module.exports.clear = () => {
|
||||
lineMetadata = null;
|
||||
flattenedLists = null;
|
||||
let inlineCodeSpanRanges = null;
|
||||
module.exports.inlineCodeSpanRanges = (value) => {
|
||||
if (value) {
|
||||
inlineCodeSpanRanges = value;
|
||||
}
|
||||
return inlineCodeSpanRanges;
|
||||
};
|
||||
|
||||
let lineMetadata = null;
|
||||
module.exports.lineMetadata = (value) => {
|
||||
if (value) {
|
||||
lineMetadata = value;
|
||||
}
|
||||
return lineMetadata;
|
||||
};
|
||||
|
||||
module.exports.clear = () => {
|
||||
flattenedLists = null;
|
||||
inlineCodeSpanRanges = null;
|
||||
lineMetadata = null;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue