Remove filterTokens helper (now used only by tests).

This commit is contained in:
David Anson 2024-08-18 15:34:26 -07:00
parent 2b8369ae39
commit 55729cfcf7
5 changed files with 21 additions and 61 deletions

View file

@ -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 = [];