hast-util-from-parse5 is a utility that converts a Parse5 AST into a hast tree. It is useful when you parse HTML with parse5 and want to work with hast, including optional positional information via a VFile.
Project status
- The source shows renewed maintenance: its latest update and upstream push were on 2026-10-29, about a week before today.
- Updates have been irregular, with a long gap from February 2025 to October 2026, so a predictable cadence is not evident.
AI summary generated
Recent updates
8.0.4
Version 8.0.4 fixes a crash when converting `template` elements in SVG and MathML. HTML `template` elements retain their special content handling, while SVG and MathML `template` elements are now represented as ordinary elements with children.
8.0.3
Release 8.0.3 is primarily a dependency refresh, with the release notes indicating an update to `property-information`. The code diff provided shows no application logic changes, but it does bump `property-information` and a couple of development tooling packages.
8.0.2
Release 8.0.2 primarily refactors TypeScript typings (including declaration maps and switching to `@import`s) and bumps `hastscript`. The code diff also reveals at least one behavioral change related to how unknown attribute values are handled, which is not mentioned in the release notes.
8.0.1
Release 8.0.1 includes a small fix related to the optional `verbose` option. The release notes mention correcting the type of an optional option, and the code diff shows related changes in how `verbose` is typed and passed into the underlying conversion.
8.0.0
Release 8.0.0 updates the package for modern tooling and Node.js 16+, switches to a proper `exports` entry point, and adds a new `index.d.ts` to expose TypeScript types. It also changes how positional/location data is represented in the generated hast, not just how options are accepted.
BreakingFeatures7.1.2
Version 7.1.2 includes a small fix described in the release notes as “Fix some props”. The code change specifically alters how element attributes are mapped into `properties`, with special handling to avoid writing certain prototype-related property names.
Security7.1.1
Release 7.1.1 mainly updates documentation and TypeScript types, and it adjusts the project to account for changes related to newer `parse5` versions. The only explicitly called out change in the release notes is exporting the `Space` type, plus general type/test updates.
Features7.1.0
Release 7.1.0 makes a small set of changes: it enables TypeScript strict mode and updates the vfile-location dependency. The code changes behind this release also include several related type and dependency adjustments that are not described in the release notes.
7.0.0
Release 7.0.0 migrates the package to ESM, adds JSDoc-based types, and changes how doctypes are handled. The code refactor is substantial: the entrypoint now exposes a named export (fromParse5) and the implementation moved under lib/.
BreakingFeatures6.0.1
Release 6.0.1 focuses on fixing positional information, and it bumps the hastscript dependency. The code change shows that positional computation was reworked to use vfile-location, not manual newline counting.
6.0.0
Release 6.0.0 primarily adds TypeScript type definitions for `hast-util-from-parse5`. The release notes only mention “Add types”, but the diff also includes runtime dependency changes and a code change in how positional `end` data is copied.
Features