Back to Explore

syntax-tree/hast-util-heading-rank

GitHub
1 watchersOpen source

Last release: 8/2/2023

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 latest known upstream update is 3.0.0 on 2023-08-02, and the last recorded push is also 2023-08-02, suggesting active maintenance in that period but no evidence of ongoing updates after then.
  • Apparent update cadence is sparse, with releases in 2021-05-13 (2.1.0), 2023-01-09 (2.1.1), and 2023-08-02 (3.0.0), which points to an evolving project with large intervals rather than a frequent release cycle.

AI summary generated Today

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

Recent updates

  • 3.0.0

    8/2/2023

    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

    1/9/2023

    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

    5/13/2021

    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