Skip to content

Add support for a node / list of nodes at fields other than children #11

Closed
@wooorm

Description

@wooorm

Subject of the feature

As unist is slowly moving a tiny bit away from just content, it starts to make more sense to add support for nodes in other places than children.

Problem

Thinking about JSX elements in Markdown which have open and close fields leading to jsxTag nodes.

Expected behaviour

Something like this maybe?

root[2]
├─ node [id="a"]
└─ parent[1]
   ┊  someKey: node [id="b"]
   ┊  otherKey[2]:
   ┊  ├─ node [id="c"]
   ┊  └─ node [id="d"]
   └─ node [id="e"]

Alternatives

Currently it’s something like:

root[2]
├─ node [id="a"]
└─ parent[1] [someKey={type: "node","id":"b"}][otherKey=[{type: "node","id":"c"}, {type: "node","id":"d"}]]
   └─ node [id="e"]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions