npm / doctoc
doctoc
What changed in doctoc 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-24.
1 breaking10 new APIs and options2 behavior and defaults10 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initdoctoc 223 changes
Breaking changes 1
Adds the ability to define the minimum heading level.
New APIs and options 10
Add a minLines-based option for generating a table of contents.
Allow a different symbol to be used for each table-of-contents level.
Allow configuring where a new table of contents is inserted.
Adds control over the header and footer.
Adds control over indenting width.
Logging verbosity can be managed using the log level.
Adds configurable padding before the title.
Adds a dry run option for CI environments.
Adds support for MDX.
Adds the ability to define the minimum number of items in a table of contents.
Behavior and default changes 2
Support frontmatter in documents when generating a table of contents.
Support header IDs included in header text when generating the table of contents.
Fixes and other changes 10
Set line endings based on the file being processed.
Correctly determines the title.
Fixes handling of headings that differ only by symbols.
Improves handling of invalid HTML.
Fixes handling of references in headers.
Fixes handling of user-defined IDs for headings.
Fixes handling of emoji-titled headers.
Properly handles files with whitespace.
Fixes formatted headers.
Adds checks for line breaks around the skip tag.