Crash of markdownlint-cli2 and vscode-markdownlint on invalid markdown
Ran a big codebase of markdown through the linter, and found an edge case that results in the parser crashing and unable to process the remainder of the files for linting. This happens both from the cli version and the vscode version (since it seems like the vscode one just uses this lib internally)
Output from linter is:
[1:27:05 PM] ERROR: Exception while linting with markdownlint-cli2:
TypeError: e[n].slice is not a function
example markdown that reproduces:
1. some text
:::note
inner text
:::
2. some more text
It appears to be related to a :::note style callout existing within an ordered list.
Some more versions that reproduce the crash:
- some text
:::note
inner text
:::
- some more text
* some text
:::note
inner text
:::
* some text
:::note
a
Thank you for reporting this! It looks like an issue with the micromark parsing library. I've opened an issue for them here: https://github.com/micromark/micromark/issues/173.
I've made a PR to the micromark-extension-directive project which should prevent this crash once merged, released, and incorporated: https://github.com/micromark/micromark-extension-directive/pull/27
v0.15.0