Skip to content

node.data info lost after raw #29

@JounQin

Description

@JounQin

Initial checklist

Affected package

hast-util-raw@9.1.0

Steps to reproduce

https://github.com/JounQin/test/tree/repro/hast-util-raw

Simply run node index.js

Actual behavior

{
  "type": "element",
  "tagName": "p",
  "properties": {},
  "children": [
    {
      "type": "element",
      "tagName": "code",
      "properties": {
        "meta": "title=\"Hello World\""
      },
      "children": []
    }
  ]
}

Expected behavior

{
  "type": "element",
  "tagName": "p",
  "properties": {},
  "children": [
    {
      "type": "element",
      "tagName": "code",
      "properties": {
        "meta": "title=\"Hello World\""
      },
      "data": {
        "meta": "title=\"Hello World\""
      },
      "children": []
    }
  ]
}

Runtime

node@22.15.1

Package manager

yarn@4.9.1

Operating system

macOS Sequoia 15.5 (24F74)

Build and bundle tools

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions