We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When a heading has no content, the plugin crashes because it is trying to access properties of the child nodes of the heading, which don't exist.
Here is the output from a node session illustrating the issue.
node
$ node > const markdownIt = require('markdown-it') undefined > const markdownItTocAndAnchor = require('markdown-it-toc-and-anchor').default undefined > markdownIt().use(markdownItTocAndAnchor).render('## Real heading\n\n##\n\nEmpty heading above') TypeError: Cannot read property 'type' of undefined at Array.<anonymous> (/node_modules/markdown-it-toc-and-anchor/dist/index.js:55:53) at Core.process (/node_modules/markdown-it/lib/parser_core.js:51:13) at MarkdownIt.parse (/node_modules/markdown-it/lib/index.js:523:13) at MarkdownIt.render (/node_modules/markdown-it/lib/index.js:543:36)
The versions used are:
markdown-it
markdown-it-toc-and-anchor
The text was updated successfully, but these errors were encountered:
This was introduced in #34 but still hasn't been fixed, see #34 (comment)
Sorry, something went wrong.
fix: better empty heading check, #34, #36, #45
00ddf0b
fixed in v4.2.0
No branches or pull requests
When a heading has no content, the plugin crashes because it is trying to access properties of the child nodes of the heading, which don't exist.
Here is the output from a
node
session illustrating the issue.The versions used are:
markdown-it
8.4.1markdown-it-toc-and-anchor
4.1.2The text was updated successfully, but these errors were encountered: