# What changed in doctoc

> 23 changes in doctoc 2 from its official release notes, upgrade guides and advisories: 1 breaking, 10 new APIs and options. Each one cited. Sources checked 2026-10-24. HTML: https://unstale.sh/npm/doctoc/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## doctoc 2

### Breaking changes

- Adds the ability to define the minimum heading level. (2.3.0) — [release notes](https://github.com/thlorenz/doctoc/releases/tag/v2.3.0)

### New APIs and options

- Add a minLines-based option for generating a table of contents. (2.5.0) — [release notes](https://github.com/thlorenz/doctoc/releases/tag/v2.5.0)
- Allow a different symbol to be used for each table-of-contents level. (2.5.0) — [release notes](https://github.com/thlorenz/doctoc/releases/tag/v2.5.0)
- Allow configuring where a new table of contents is inserted. (2.5.0) — [release notes](https://github.com/thlorenz/doctoc/releases/tag/v2.5.0)
- Adds control over the header and footer. (2.4.0) — [release notes](https://github.com/thlorenz/doctoc/releases/tag/v2.4.0)
- Adds control over indenting width. (2.4.0) — [release notes](https://github.com/thlorenz/doctoc/releases/tag/v2.4.0)
- Logging verbosity can be managed using the log level. (2.4.0) — [release notes](https://github.com/thlorenz/doctoc/releases/tag/v2.4.0)
- Adds configurable padding before the title. (2.4.0) — [release notes](https://github.com/thlorenz/doctoc/releases/tag/v2.4.0)
- Adds a dry run option for CI environments. (2.3.0) — [release notes](https://github.com/thlorenz/doctoc/releases/tag/v2.3.0)
- Adds support for MDX. (2.3.0) — [release notes](https://github.com/thlorenz/doctoc/releases/tag/v2.3.0)
- Adds the ability to define the minimum number of items in a table of contents. (2.3.0) — [release notes](https://github.com/thlorenz/doctoc/releases/tag/v2.3.0)

### Behavior and default changes

- Support frontmatter in documents when generating a table of contents. (2.5.0) — [release notes](https://github.com/thlorenz/doctoc/releases/tag/v2.5.0)
- Support header IDs included in header text when generating the table of contents. (2.5.0) — [release notes](https://github.com/thlorenz/doctoc/releases/tag/v2.5.0)

### Fixes and other changes

- Set line endings based on the file being processed. (2.5.0) — [release notes](https://github.com/thlorenz/doctoc/releases/tag/v2.5.0)
- Correctly determines the title. (2.4.1) — [release notes](https://github.com/thlorenz/doctoc/releases/tag/v2.4.1)
- Fixes handling of headings that differ only by symbols. (2.4.0) — [release notes](https://github.com/thlorenz/doctoc/releases/tag/v2.4.0)
- Improves handling of invalid HTML. (2.4.0) — [release notes](https://github.com/thlorenz/doctoc/releases/tag/v2.4.0)
- Fixes handling of references in headers. (2.4.0) — [release notes](https://github.com/thlorenz/doctoc/releases/tag/v2.4.0)
- Fixes handling of user-defined IDs for headings. (2.4.0) — [release notes](https://github.com/thlorenz/doctoc/releases/tag/v2.4.0)
- Fixes handling of emoji-titled headers. (2.3.0) — [release notes](https://github.com/thlorenz/doctoc/releases/tag/v2.3.0)
- Properly handles files with whitespace. (2.3.0) — [release notes](https://github.com/thlorenz/doctoc/releases/tag/v2.3.0)
- Fixes formatted headers. (2.3.0) — [release notes](https://github.com/thlorenz/doctoc/releases/tag/v2.3.0)
- Adds checks for line breaks around the skip tag. (2.3.0) — [release notes](https://github.com/thlorenz/doctoc/releases/tag/v2.3.0)
