mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-21 21:30:47 +02:00
Remove filterTokens helper (now used only by tests).
This commit is contained in:
parent
2b8369ae39
commit
55729cfcf7
5 changed files with 21 additions and 61 deletions
|
@ -307,23 +307,6 @@ module.exports.unorderedListStyleFor = function unorderedListStyleFor(token) {
|
|||
* @returns {void}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Calls the provided function for each matching token.
|
||||
*
|
||||
* @param {Object} params RuleParams instance.
|
||||
* @param {string} type Token type identifier.
|
||||
* @param {TokenCallback} handler Callback function.
|
||||
* @returns {void}
|
||||
*/
|
||||
function filterTokens(params, type, handler) {
|
||||
for (const token of params.parsers.markdownit.tokens) {
|
||||
if (token.type === type) {
|
||||
handler(token);
|
||||
}
|
||||
}
|
||||
}
|
||||
module.exports.filterTokens = filterTokens;
|
||||
|
||||
// Returns (nested) lists as a flat array (in order)
|
||||
module.exports.flattenLists = function flattenLists(tokens) {
|
||||
const flattenedLists = [];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue