mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-24 09:50:13 +01:00
Reimplement MD013/line-length using micromark tokens.
This commit is contained in:
parent
4072cf7417
commit
3b581a7f6d
10 changed files with 173 additions and 185 deletions
|
|
@ -231,6 +231,20 @@ function micromarkParse(
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a range of numbers to a set.
|
||||
*
|
||||
* @param {Set<number>} set Set of numbers.
|
||||
* @param {number} start Starting number.
|
||||
* @param {number} end Ending number.
|
||||
* @returns {void}
|
||||
*/
|
||||
function addRangeToSet(set, start, end) {
|
||||
for (let i = start; i <= end; i++) {
|
||||
set.add(i);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @callback AllowedPredicate
|
||||
* @param {Token} token Micromark token.
|
||||
|
|
@ -485,6 +499,7 @@ const nonContentTokens = new Set([
|
|||
|
||||
module.exports = {
|
||||
"parse": micromarkParse,
|
||||
addRangeToSet,
|
||||
filterByPredicate,
|
||||
filterByTypes,
|
||||
getDescendantsByType,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue