Back to Explore

syntax-tree/hast-util-heading-rank

GitHub
1 watchersOpen source

Last release:

hast-util-heading-rank is a small utility for hast (HTML AST) that returns the rank or depth level of heading elements, mapping h1 through h6 to numbers 1 through 6. It is useful when you need to inspect or drive logic based on the heading level in a parsed document.

Project status

  • The upstream repo for syntax-tree/hast-util-heading-rank shows no updates since 2023-08-02 (last upstream push), so it appears quiet and not actively maintained as of today (2026-06-09).
  • The visible update cadence is irregular, with major gaps (2020-03, 2021-04 to 2021-05, then 2023-08), and nothing recent enough to indicate ongoing release momentum.

AI summary generated

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

Recent updates

  • 3.0.0

    hast-util-heading-rank 3.0.0 is a major release that updates the package to use `exports`, bumps Hast typings, and changes heading rank behavior and Node.js compatibility. The main user-facing change is that `headingRank` now returns `undefined` instead of `null` when the input is not an `h1` to `h6`, and the package now requires Node.js 16.

    Breaking
  • 2.1.1

    Release 2.1.1 is described as documentation-only, but the codebase changed. The main library entry now re-exports the implementation from a new lib/ directory, and several build, test, CI, and configuration details were updated.

  • 2.1.0

    Release 2.1.0 updates the package version and adjusts the JSDoc typing for the exported `headingRank` function. The change is focused on type support for passing a wider set of HAST nodes, rather than modifying runtime logic.

    Features
  • 2.0.0

    Version 2.0.0 converts the package to ESM and adds JSDoc-based typing to improve developer experience. The implementation is largely the same, but packaging, exports, and the build/test tooling have been modernized.

    Breaking
  • 1.0.1

    Release 1.0.1 updates hast-util-heading-rank to handle missing or non-node inputs safely. The notes mention fixing a missing node case, and the code changes add a null guard and new test coverage.

  • 1.0.0

    Release 1.0.0 was published on 2020-03-04. The release notes contain no described changes (only a “💯” marker), so there is no actionable information available about new features, fixes, or breaking changes.