Releases: mattbal/rehype-toc
Releases · mattbal/rehype-toc
v3.5.0
v3.4.0
Changes
- Updated all dependencies to latest versions
- Migrated project from CommonJS to ECMAScript Module
- Switched from nyc to c8 for code coverage
- Updated ESLint config to support ESLint v9
- Removed deprecated ESLint code formatting rules and replaced with Prettier
- Added lint-staged and Husky to automatically run Prettier and ESLint on files that are marked as staged via
git add
before you commit - Updated types to use types from the hast library instead of the old custom types that were an oversimplification of
hast
's types. (Should lead to better error handling) - Made it so that attempting to incorrectly insert the table of contents with
beforebegin
orafter end
when there is no or node throws an error - Added a new rehype-toc configuration option:
addClassSuffix
, which allows you to disable adding suffixes to the end of rehype-toc class names. (Useful if you want to supply rehype-toc elements with multiple classnames. Previously, supplying multiple classnames likecssClasses: { listItem: ‘toc-item focused semibold’}
would have returned duplicate classnames in your HTML like:toc-item focused semibold toc-item focused semibold-h2
)