mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 22:10: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
|
|
@ -306,14 +306,14 @@ module.exports.forEachLine = function forEachLine(lineMetadata, handler) {
|
|||
};
|
||||
|
||||
// Returns (nested) lists as a flat array (in order)
|
||||
module.exports.flattenLists = function flattenLists(params) {
|
||||
module.exports.flattenLists = function flattenLists(tokens) {
|
||||
const flattenedLists = [];
|
||||
const stack = [];
|
||||
let current = null;
|
||||
let nesting = 0;
|
||||
const nestingStack = [];
|
||||
let lastWithMap = { "map": [ 0, 1 ] };
|
||||
params.tokens.forEach((token) => {
|
||||
tokens.forEach((token) => {
|
||||
if (isMathBlock(token) && token.map[1]) {
|
||||
// markdown-it-texmath plugin does not account for math_block_end
|
||||
token.map[1]++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue