[GH-ISSUE #339] Error: Property 'range' of onError parameter is incorrect. #289

Closed
opened 2026-03-03 01:25:27 +03:00 by kerem · 4 comments
Owner

Originally created by @Luc-Olsthoorn on GitHub (Oct 12, 2020).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/339

Trying to validate:

a<pre>&rpar; a &lpar; a &rpar;[a]~</pre>

With these options:

const config = {
  "_docs_for_this_file": "https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md",
  "default":false,
  "MD002": {
    "level": 2
  },
  "MD005":true,
  "MD008":true,
  "MD018":true,
  "MD019":true,
  "MD020":true,
  "MD021":true,

  "MD023":true,
  "MD029":true,
  "MD030":true,

  "MD032":true,
  "MD039":true,

  "MD042":true,
  "MD043":true,


}

Results in:

Error: Property 'range' of onError parameter is incorrect.
    at throwError (/Users/lucolsthoorn/Documents/dev/ContentSpec/server/node_modules/markdownlint/lib/markdownlint.js:465:13)
    at onError (/Users/lucolsthoorn/Documents/dev/ContentSpec/server/node_modules/markdownlint/lib/markdownlint.js:494:9)
    at addError (/Users/lucolsthoorn/Documents/dev/ContentSpec/server/node_modules/markdownlint/helpers/helpers.js:410:3)
    at /Users/lucolsthoorn/Documents/dev/ContentSpec/server/node_modules/markdownlint/lib/md011.js:23:9
    at forChild (/Users/lucolsthoorn/Documents/dev/ContentSpec/server/node_modules/markdownlint/helpers/helpers.js:299:9)
    at Array.forEach (<anonymous>)
    at forToken (/Users/lucolsthoorn/Documents/dev/ContentSpec/server/node_modules/markdownlint/helpers/helpers.js:297:20)
    at forToken (/Users/lucolsthoorn/Documents/dev/ContentSpec/server/node_modules/markdownlint/helpers/helpers.js:208:7)
    at Array.forEach (<anonymous>)
    at filterTokens (/Users/lucolsthoorn/Documents/dev/ContentSpec/server/node_modules/markdownlint/helpers/helpers.js:206:17)

Versions:
node/14.0.0
"markdownlint": "^0.21.0",

Originally created by @Luc-Olsthoorn on GitHub (Oct 12, 2020). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/339 Trying to validate: `a<pre>&rpar; a &lpar; a &rpar;[a]~</pre>` With these options: ``` const config = { "_docs_for_this_file": "https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md", "default":false, "MD002": { "level": 2 }, "MD005":true, "MD008":true, "MD018":true, "MD019":true, "MD020":true, "MD021":true, "MD023":true, "MD029":true, "MD030":true, "MD032":true, "MD039":true, "MD042":true, "MD043":true, } ``` Results in: ``` Error: Property 'range' of onError parameter is incorrect. at throwError (/Users/lucolsthoorn/Documents/dev/ContentSpec/server/node_modules/markdownlint/lib/markdownlint.js:465:13) at onError (/Users/lucolsthoorn/Documents/dev/ContentSpec/server/node_modules/markdownlint/lib/markdownlint.js:494:9) at addError (/Users/lucolsthoorn/Documents/dev/ContentSpec/server/node_modules/markdownlint/helpers/helpers.js:410:3) at /Users/lucolsthoorn/Documents/dev/ContentSpec/server/node_modules/markdownlint/lib/md011.js:23:9 at forChild (/Users/lucolsthoorn/Documents/dev/ContentSpec/server/node_modules/markdownlint/helpers/helpers.js:299:9) at Array.forEach (<anonymous>) at forToken (/Users/lucolsthoorn/Documents/dev/ContentSpec/server/node_modules/markdownlint/helpers/helpers.js:297:20) at forToken (/Users/lucolsthoorn/Documents/dev/ContentSpec/server/node_modules/markdownlint/helpers/helpers.js:208:7) at Array.forEach (<anonymous>) at filterTokens (/Users/lucolsthoorn/Documents/dev/ContentSpec/server/node_modules/markdownlint/helpers/helpers.js:206:17) ``` Versions: `node/14.0.0` `"markdownlint": "^0.21.0",`
kerem 2026-03-03 01:25:27 +03:00
Author
Owner
<!-- gh-comment-id:707217725 --> @DavidAnson commented on GitHub (Oct 12, 2020): Sorry about that! https://dlaa.me/markdownlint/#%25m%23%20Issue%20339%0A%0A%3C!--%20markdownlint-disable%20md033%20--%3E%0A%0Aa%3Cpre%3E%26rpar%3B%20a%20%26lpar%3B%20a%20%26rpar%3B%5Ba%5D~%3C%2Fpre%3E%0A
Author
Owner

@DavidAnson commented on GitHub (Oct 13, 2020):

By inspection, the problem seems to be related to the escaped parens (lpar/rpar). Out of curiosity, why is that done here?

<!-- gh-comment-id:707501161 --> @DavidAnson commented on GitHub (Oct 13, 2020): By inspection, the problem seems to be related to the escaped parens (lpar/rpar). Out of curiosity, why is that done here?
Author
Owner

@Luc-Olsthoorn commented on GitHub (Oct 13, 2020):

I highly redacted/reduced the code to make it just the bug, but the real reason I think its like that (no human would write something like that), is that our content was originally in XML format and someone before my time used a library/custom code to convert it to markdown. I'm pretty sure its an artifact of that.

It probably could be changed of course, but we have thousands of pieces of content that my linter (which includes markdown lint) needs to be able to process, so who knows what other pieces have this artifact, and when it will crop up again!

<!-- gh-comment-id:707736615 --> @Luc-Olsthoorn commented on GitHub (Oct 13, 2020): I highly redacted/reduced the code to make it just the bug, but the real reason I think its like that (no human would write something like that), is that our content was originally in XML format and someone before my time used a library/custom code to convert it to markdown. I'm pretty sure its an artifact of that. It probably could be changed of course, but we have thousands of pieces of content that my linter (which includes markdown lint) needs to be able to process, so who knows what other pieces have this artifact, and when it will crop up again!
Author
Owner

@DavidAnson commented on GitHub (Oct 13, 2020):

Makes sense! I'll probably fix this such that there's no range provided for cases like this. There will still be an error on the right line, just no column/length and so no fix. You've disabled the failing rule anyway, so won't notice the limitation.

<!-- gh-comment-id:707818483 --> @DavidAnson commented on GitHub (Oct 13, 2020): Makes sense! I'll probably fix this such that there's no range provided for cases like this. There will still be an error on the right line, just no column/length and so no fix. You've disabled the failing rule anyway, so won't notice the limitation.
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#289
No description provided.