Oops! I’ll keep that in mind next time I ask for help.
As for the code, it was just a toy code, really. I was just declaring a string and trying to parse it as:
const MarkdownIt = require('markdown-it')();
const test = '[testlink]';
console.log(MarkdownIt.parse(test));
This resulted in the above error. Looks like I misread the API documentation, and thought that an empty object was the default env parameter. Passing an empty object as the second parameter makes it work as expected.
My eventual application would be to use parse, as I’m trying to extract the text by converting the markdown to a stream of tokens and extracting only the content of the text tokens from that. Is that the wrong way to go about it? If so, how should I approach this?