Back to Explore

rehypejs/rehype-slug

GitHub
1 watchersOpen source

Last release:

rehype-slug is a unified, rehype plugin that adds `id` attributes to heading elements (`<h1>` through `<h6>`) based on their text, useful for linking to specific document sections. It matches GitHub-style slugging (using github-slugger) and can be configured with an optional `prefix` for the generated `id`s.

Project status

  • Maintenance status: Appears not actively maintained as of 2026-06-09, with the latest upstream push in 2023-08-31 and no newer updates shown in the provided history.
  • Update cadence: Historically produced several updates from 2017-2023, but the most recent change is about 2 years ago, indicating a long pause rather than regular cadence.

AI summary generated

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • 6.0.0

    rehype-slug 6.0.0 is a major release that updates the project to modern unified/rehype ecosystem versions, and changes packaging to use the `exports` field. It also updates CI and tooling to current Node support.

    Breaking
  • 5.1.0

    rehype-slug 5.1.0 adds support for prefixing generated heading ids via a new `options.prefix` option. The plugin’s public usage and TypeScript types were updated accordingly, and several dependencies/dev tools were bumped.

    Features
  • 5.0.1

    Release 5.0.1 is presented as a documentation-only update. However, the diff also includes a change to the JSDoc TypeScript plugin typing in index.js, plus various devDependency and tooling version bumps.

  • 5.0.0

    rehype-slug 5.0.0 converts the package to ESM and refactors the implementation to use modern versions of the unified ecosystem utilities. The release notes mention ESM, JSDoc-based types, and dependency updates, and the code diff confirms those themes. However, the diff also reveals some additional packaging and behavioral changes that are not called out in the release notes.

    Breaking
  • 4.0.1

    Release 4.0.1 makes a small packaging update for the rehype-slug package. The release notes state that TypeScript type declarations were wired into package.json via a `types` field.

  • 4.0.0

    Version 4.0.0 adds TypeScript typings for the rehype-slug plugin and refactors the implementation. The shipped code change also swaps the heading-detection utility and introduces a TypeScript-focused test step, alongside broader toolchain updates.

    Features
  • 3.0.0

    Release 3.0.0 primarily updates the dependency `unist-util-visit` and refreshes documentation. The provided release notes call out a potentially breaking TypeScript change from `unist-util-visit`, plus prose/metadata cleanup and added security guidance.

    BreakingSecurity
  • 2.0.3

    Release 2.0.3 is described as a prose refactor, but the actual diff also updates CI configuration and several development toolchain dependencies. No runtime/plugin code changes are shown in the provided diff, only repository configuration and README/package metadata.

  • 2.0.2

    Release 2.0.2 focuses on repository and documentation housekeeping, including moving URLs to HTTPS, adding a Contribute section, and migrating the project metadata/links to the rehypejs organization. The code diff shows the published plugin logic (index.js) is essentially unchanged, but the release also introduces substantial development and CI tooling changes.

  • 2.0.1

    Release 2.0.1 contains mostly documentation and maintenance-type changes, with README example edits as the only items explicitly mentioned in the release notes. The code diff also shows non-trivial changes to the published package files, including an alteration in the module export statement and several tooling and devDependency updates.