rehype-autolink-headings is a unified (rehype) plugin that scans HTML headings (`h1` through `h6`) for existing `id` properties and injects a link inside each heading that points back to itself. It’s useful for long documents where you want readers to easily share or navigate to specific sections, with configurable placement and link content.
Project status
- The latest recorded upstream activity is an update on 2024-09-16 (v7.1.1), with no evidence of further updates since then (as of 2026-06-09, this is about 21 months), so the project appears quiet or in maintenance mode rather than actively maintained.
- Update cadence has been irregular, with clusters in 2023 to 2024 (v7.0.0 in 2023-09, v7.1.0 in 2023-11, v7.1.1 in 2024-09) and much longer gaps before that (notably 2021 to 2023).
AI summary generated
Recent updates
7.1.1
Release 7.1.1 mainly restructures TypeScript typings, moving inline JSDoc typedefs into dedicated declaration files and enabling declaration maps. It also removes an unused runtime dependency and updates a few CI and dev tooling components.
7.1.0
Release 7.1.0 adds two new capabilities to rehype-autolink-headings: a `headingProperties` option and support for using `content` when `behavior` is set to `wrap`. The implementation also changes internal option handling and extends the `wrap` behavior logic to insert or replace link children based on how `content` is provided.
Features7.0.0
rehype-autolink-headings 7.0.0 updates the package for modern tooling (notably Node.js 16+) and refreshes the public API types and module packaging (exports field). It also adds support for computing link properties via a function and updates documentation/examples.
BreakingFeatures6.1.1
Release 6.1.1 is documented only as an “Add improved docs” change. The diff, however, also includes a packaging and build refactor that moves the actual plugin implementation into a new lib/ directory.
6.1.0
Release 6.1.0 adds a new `test` option that lets consumers restrict which heading elements get autolinked. The implementation uses `hast-util-is-element` to evaluate whether each candidate heading should be processed, while keeping the previous default behavior of linking all headings when `test` is not provided.
Features6.0.0
Version 6.0.0 migrates rehype-autolink-headings to ESM, replaces CommonJS exports with a default export, and adds JSDoc-based typing. The package also updates several major dependencies and modernizes its test/build toolchain. Code changes suggest a few behavioral and packaging differences that are not fully covered by the short release notes.
Breaking5.1.0
Release 5.1.0 focuses on tightening the TypeScript types for the `content` and `group` options so the callback parameter is typed as `Element` rather than the more general `Node`. The diff also includes several ancillary build/CI and tooling changes not mentioned in the release notes.
5.0.1
Release 5.0.1 updates the package metadata for reype-autolink-headings. The release notes mention adding the TypeScript types entry to package.json, and the code diff confirms this exact change.
Features5.0.0
Release 5.0.0 adds TypeScript type definitions and refactors the implementation. The code change focuses on reducing bundle size, but it also updates how heading elements are detected.
Features4.0.0
Version 4.0.0 extends `rehype-autolink-headings` to support adding links before or after headings, and introduces a `group` option to wrap the heading and link. It also changes default link accessibility behavior by adding `tabIndex: -1` to hidden links, and updates the plugin implementation to support more configurable insertion logic.
BreakingFeatures