mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Refactor helpers slightly for consistency.
This commit is contained in:
parent
124b7e2276
commit
97effd921e
6 changed files with 36 additions and 50 deletions
|
@ -3,7 +3,7 @@
|
|||
"use strict";
|
||||
|
||||
const { addErrorDetailIf } = require("../helpers");
|
||||
const { getDescendantsByType, getTokenParentOfType } = require("../helpers/micromark.cjs");
|
||||
const { getDescendantsByType, getParentOfType } = require("../helpers/micromark.cjs");
|
||||
const { filterByTypesCached } = require("./cache");
|
||||
|
||||
const markerToStyle = {
|
||||
|
@ -46,7 +46,7 @@ module.exports = {
|
|||
/** @type {import("../helpers/micromark.cjs").Token | null} */
|
||||
let parent = listUnordered;
|
||||
// @ts-ignore
|
||||
while ((parent = getTokenParentOfType(parent, [ "listOrdered", "listUnordered" ]))) {
|
||||
while ((parent = getParentOfType(parent, [ "listOrdered", "listUnordered" ]))) {
|
||||
nesting++;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue