Skip to content

Releases: mattbal/rehype-toc

v3.5.0

19 Apr 23:10
Compare
Choose a tag to compare

Changes

  • Added more customization options to addClassSuffix

v3.4.0

18 Apr 01:06
Compare
Choose a tag to compare

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 or after 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 like cssClasses: { listItem: ‘toc-item focused semibold’} would have returned duplicate classnames in your HTML like: toc-item focused semibold toc-item focused semibold-h2)