See, e.g., other plugins such as https://github.com/markdown-it/markdown-it-container/blob/master/index.js. I was working around this in my code. It's the sort of thing you might not notice if you're just processing markdown to create html. However, I use markdown-it only to tokenize markdown, then keep track of what markdown produced the given tokens for the purposes of caching, and then it is critically important that the map be correct.
See, e.g., other plugins such as https://github.com/markdown-it/markdown-it-container/blob/master/index.js. I was working around this in my code. It's the sort of thing you might not notice if you're just processing markdown to create html. However, I use markdown-it only to tokenize markdown, then keep track of what markdown produced the given tokens for the purposes of caching, and then it is critically important that the map be correct.