`mdast-util-to-hast` is a utility that converts an mdast (Markdown AST) input syntax tree into a hast (HTML AST) syntax tree. It is useful when you want to work with ASTs and turn parsed markdown structures into an HTML-oriented tree structure for further processing.
Project status
- Actively maintained: The most recent upstream push and published updates are both dated 2025-11-23, which is about 6.5 months before today (2026-06-09). Recent updates continue to address behavior and TypeScript surface area.
- Apparent updates cadence: Updates are infrequent but ongoing, with the prior version before 13.2.1 being 13.2.0 on 2024-06-07 (roughly a year gap), followed by a minor follow-up in 2025-11-23.
AI summary generated
Recent updates
13.2.1
Release 13.2.1 mainly addresses how `code` blocks with `lang` values containing spaces are converted into `className` values in the generated HAST. It also refactors JSDoc typing to use `@import` syntax and enables TypeScript declaration map generation.
13.2.0
Version 13.2.0 adds TypeScript typings so hast `ElementData` can include a `meta` field (intended for `data.meta` when converting from mdast to hast). The remaining changes are mostly internal refactors plus tooling and dependency upgrades.
Features13.1.0
Release 13.1.0 adds support for passing a `file` (a `VFile`) through the `toHast` options so handlers can reference the originating virtual file. The change is reflected in the TypeScript/JSDoc types, README configuration docs, and a new test that validates message emission via the provided `VFile`.
Features13.0.2
Release 13.0.2 fixes handling of `data.hProperties` for `tableCell` nodes during mdast to hast conversion. The change ensures cell-level properties are applied to the resulting `td` element as expected.
13.0.1
Release 13.0.1 includes a small change to how text is trimmed around `break` nodes. It also bumps a couple of key dependencies and includes minor doc and test cleanups.
13.0.0
Release 13.0.0 is a major update that changes core transformation behavior, modernizes module packaging, and introduces GitHub-specific footnote backreference handling. The biggest documented impacts are Node.js 16+ support, removal of deprecated APIs (including Footnote node support and state helper functions), and a shift to returning `undefined` instead of `null` plus always returning a root node from `toHast`.
BreakingFeatures12.3.0
Version 12.3.0 adds helper utilities to the internal `state` object (including `wrap`, `one`, and `all`) and improves footnote and table handling. It also renames `H` to `State` and adjusts the TypeScript surface by introducing an `index.d.ts` entrypoint. The code diff shows a broad internal refactor from a callable handler context (`h`) to a `state`-based API across all node handlers.
BreakingFeatures12.2.6
Release 12.2.6 updates mdast-util-to-hast with a targeted change related to internal type definitions. The code diff shows no runtime logic changes, only adjustments to JSDoc typedefs used for typing.
12.2.5
Release 12.2.5 is described as a TypeScript typing change to use `module: node16`. The actual diff largely consists of JSDoc/typing refactors across handler modules plus a small TypeScript configuration adjustment, with no clear runtime logic changes.
12.2.4
Version 12.2.4 updates URL handling to prevent double encoding/decoding issues when converting mdast links and images to hast. The release notes mention a single change, but the code shows a broader switch in URI utility usage and a dependency bump.