[GH-ISSUE #686] MD052: "Error: Property 'range' of onError parameter is incorrect." #2358

Closed
opened 2026-03-07 20:07:01 +03:00 by kerem · 3 comments
Owner

Originally created by @scottamain on GitHub (Dec 21, 2022).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/686

My Markdown file includes some math formulas, and it appears that some mixed bracket-and-parentheses interval notations, such as [0, N), causes the following error:

Error: Property 'range' of onError parameter is incorrect.
    at throwError (/app/node_modules/markdownlint/lib/markdownlint.js:594:13)
    at onError (/app/node_modules/markdownlint/lib/markdownlint.js:626:9)
    at addError (/app/node_modules/markdownlint/helpers/helpers.js:521:3)
    at Object.MD052 [as function] (/app/node_modules/markdownlint/lib/md052.js:24:11)
    at invokeRuleFunction (/app/node_modules/markdownlint/lib/markdownlint.js:686:51)
    at forRule (/app/node_modules/markdownlint/lib/markdownlint.js:697:7)
    at Array.map (<anonymous>)
    at lintContent (/app/node_modules/markdownlint/lib/markdownlint.js:764:44)
    at lintContentWrapper (/app/node_modules/markdownlint/lib/markdownlint.js:814:12)
    at lintFile (/app/node_modules/markdownlint/lib/markdownlint.js:830:5)

I've been able to narrow down the offending text to the following strings in a list. I can reproduce the error only when these strings are in this exact order and in a list (I've removed all other text that doesn't seem to affect the error). So you should be able to reproduce the error with this test.md file:

# Test MD052 error

* [0, N)
* `inputs[0][d]`
* `inputs[k]`
Originally created by @scottamain on GitHub (Dec 21, 2022). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/686 My Markdown file includes some math formulas, and it appears that some mixed bracket-and-parentheses interval notations, such as [0, N), causes the following error: ``` Error: Property 'range' of onError parameter is incorrect. at throwError (/app/node_modules/markdownlint/lib/markdownlint.js:594:13) at onError (/app/node_modules/markdownlint/lib/markdownlint.js:626:9) at addError (/app/node_modules/markdownlint/helpers/helpers.js:521:3) at Object.MD052 [as function] (/app/node_modules/markdownlint/lib/md052.js:24:11) at invokeRuleFunction (/app/node_modules/markdownlint/lib/markdownlint.js:686:51) at forRule (/app/node_modules/markdownlint/lib/markdownlint.js:697:7) at Array.map (<anonymous>) at lintContent (/app/node_modules/markdownlint/lib/markdownlint.js:764:44) at lintContentWrapper (/app/node_modules/markdownlint/lib/markdownlint.js:814:12) at lintFile (/app/node_modules/markdownlint/lib/markdownlint.js:830:5) ``` I've been able to narrow down the offending text to the following strings in a list. I can reproduce the error only when these strings are in this exact order and in a list (I've removed all other text that doesn't seem to affect the error). So you should be able to reproduce the error with this `test.md` file: ``` # Test MD052 error * [0, N) * `inputs[0][d]` * `inputs[k]` ```
kerem 2026-03-07 20:07:01 +03:00
Author
Owner

@DavidAnson commented on GitHub (Dec 22, 2022):

Link to reproduce with demo page: (as of v0.26.2): https://dlaa.me/markdownlint/#%25m%23%20Test%20MD052%20error%0A%0A*%20%5B0%2C%20N)%0A*%20%60inputs%5B0%5D%5Bd%5D%60%0A*%20%60inputs%5Bk%5D%60%0A

<!-- gh-comment-id:1362307143 --> @DavidAnson commented on GitHub (Dec 22, 2022): Link to reproduce with demo page: (as of v0.26.2): https://dlaa.me/markdownlint/#%25m%23%20Test%20MD052%20error%0A%0A*%20%5B0%2C%20N)%0A*%20%60inputs%5B0%5D%5Bd%5D%60%0A*%20%60inputs%5Bk%5D%60%0A
Author
Owner

@DavidAnson commented on GitHub (Dec 22, 2022):

This issue does not reproduce in the next branch which will become the next release soon. The commit that fixed it is: https://github.com/DavidAnson/markdownlint/commit/6974cd6012afbcb3bce95ff78d177a1730845202. Thank you for reporting the issue!

<!-- gh-comment-id:1362317370 --> @DavidAnson commented on GitHub (Dec 22, 2022): This issue does not reproduce in the `next` branch which will become the next release soon. The commit that fixed it is: <https://github.com/DavidAnson/markdownlint/commit/6974cd6012afbcb3bce95ff78d177a1730845202>. Thank you for reporting the issue!
Author
Owner

@scottamain commented on GitHub (Dec 22, 2022):

Great thank you!

<!-- gh-comment-id:1363251304 --> @scottamain commented on GitHub (Dec 22, 2022): Great thank you!
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#2358
No description provided.