Back to Explore

syntax-tree/mdast-util-to-string

GitHub
2 watchersOpen source

Last release:

mdast-util-to-string is a small utility that extracts plain text from an mdast node (or list of nodes) by returning the node’s textual fields, or otherwise serializing its children. It’s useful when you have Markdown AST content and need the heading or other node text without converting the whole Markdown. It also supports options like including image alt text and HTML values.

Project status

  • Maintenance status: Based on the last recorded upstream push (2024-04-30) and the last listed published update (4.0.0 on 2023-07-07), the source appears quiet/dormant rather than actively maintained as of 2026-06-09.
  • Update cadence: Earlier updates happened more frequently (multiple updates in 2020 to 2023), but there is a long gap since mid-2023 with no further version updates shown in the provided summaries, suggesting low recent cadence.

AI summary generated

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

Recent updates

  • 4.0.0

    Release 4.0.0 modernizes mdast-util-to-string for newer Node.js and packaging conventions. It adds a package.json exports mapping and raises the Node.js requirement to 16, along with corresponding build/test configuration updates.

    Breaking
  • 3.2.0

    Release 3.2.0 adds a new `includeHtml` option to control whether HTML node `value` is included in the output. The implementation routes the new option through the serialization logic and adds a test to cover HTML exclusion.

    Features
  • 3.1.1

    Release 3.1.1 is primarily described as documentation and refactoring related to code style, plus a tsconfig.json update. However, the actual code diff shows a functional refactor that changes how the includeImageAlt option is interpreted at runtime.

  • 3.1.0

    Release 3.1.0 adds a new `includeImageAlt` option to control whether image `alt` text is included when converting an mdast node to plain text. The code also changes the text selection logic to no longer consider `title` after `value` and `alt`.

    BreakingFeatures
  • 3.0.0

    Release 3.0.0 converts mdast-util-to-string to ESM and updates the toString implementation. It removes support for `node.title`, adds JSDoc-based typing, and updates tests/docs to match the new behavior.

    Breaking
  • 2.0.0

    Release 2.0.0 primarily adds TypeScript typings and includes a small refactor to slightly reduce bundle size. The actual runtime code change is minimal, while the repository tooling and documentation were also updated.

    Features
  • 1.1.0

    Release 1.1.0 updates mdast-util-to-string to support serializing an array (list) of nodes. It also removes the previous behavior that threw an exception when the input was not a node. The core logic was refactored, changing how children and array-like inputs are detected and serialized.

    BreakingFeatures
  • 1.0.8

    Release 1.0.8 is described in the notes only as a prose refactor. The actual diff shows metadata and documentation tweaks in readme.md, plus changes to package.json including a version/description/keywords update and devDependency bumps.

  • 1.0.7

    Release 1.0.7 updates package metadata by adding a funding section to package.json and adds a short security note to the README. No runtime source code changes are present in the provided diff.

  • 1.0.6

    Release 1.0.6 is described as a prose refactor and a switch of URLs to HTTPS. The actual code change is limited to comment formatting, but the release also includes CI configuration and development dependency updates, plus a much larger README/badge/link overhaul than the release notes indicate.