[GH-ISSUE #759] Exception when calling forEachHeading #531

Closed
opened 2026-03-03 01:27:43 +03:00 by kerem · 1 comment
Owner

Originally created by @mrsrhodehum on GitHub (Mar 30, 2023).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/759

Looks like markdownlint-cli2 version 0.6.0 is not compatible with markdownlint-rule-helpers version 0.19.0. When trying to call forEachHeading from a custom markdownlint rule:

"function": function rule(params, onError) {
        forEachHeading(params, (heading) => {

I got the following exception:

Exception has occurred: TypeError: Cannot read properties of undefined (reading 'markdownit')

Originally created by @mrsrhodehum on GitHub (Mar 30, 2023). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/759 Looks like markdownlint-cli2 version 0.6.0 is not compatible with markdownlint-rule-helpers version 0.19.0. When trying to call forEachHeading from a custom markdownlint rule: ``` "function": function rule(params, onError) { forEachHeading(params, (heading) => { ``` I got the following exception: `Exception has occurred: TypeError: Cannot read properties of undefined (reading 'markdownit')`
kerem 2026-03-03 01:27:43 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@DavidAnson commented on GitHub (Mar 30, 2023):

I don't understand. If you are getting an exception from custom rule code, why do you think that is an issue with markdownlint-cli2? If the custom rule does not work with the latest version of markdownlint-rule-helpers, it should reference an earlier version in package.json.

<!-- gh-comment-id:1490825126 --> @DavidAnson commented on GitHub (Mar 30, 2023): I don't understand. If you are getting an exception from custom rule code, why do you think that is an issue with markdownlint-cli2? If the custom rule does not work with the latest version of markdownlint-rule-helpers, it should reference an earlier version in package.json.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/markdownlint#531
No description provided.