
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
mdast-add-list-metadata
Advanced tools
Takes a markdown AST (MDAST) and adds more metadata on list
and listItem
nodes, such as the depth of nesting of a list, the index of each list item, and whether list items are ordered or unordered. Mutates the given AST.
npm install mdast-add-list-metadata
// ...
var addListMetadata = require('mdast-add-list-metadata');
unified()
.use(parse)
.use(addListMetadata)
// ...
Markdown document:
# Title
- First
- Second
- a
- Third
Input AST:
root[2] (1:1-8:1, 0-41)
├─ heading[1] (2:1-2:8, 1-8) [depth=1]
│ └─ text: "Title" (2:3-2:8, 3-8)
└─ list[3] (4:1-7:8, 10-40) [ordered=false][loose=false]
├─ listItem[1] (4:1-4:8, 10-17) [loose=false]
│ └─ paragraph[1] (4:3-4:8, 12-17)
│ └─ text: "First" (4:3-4:8, 12-17)
├─ listItem[2] (5:1-6:6, 18-32) [loose=false]
│ ├─ paragraph[1] (5:3-5:9, 20-26)
│ │ └─ text: "Second" (5:3-5:9, 20-26)
│ └─ list[1] (6:3-6:6, 29-32) [ordered=false][loose=false]
│ └─ listItem[1] (6:3-6:6, 29-32) [loose=false]
│ └─ paragraph[1] (6:5-6:6, 31-32)
│ └─ text: "a" (6:5-6:6, 31-32)
└─ listItem[1] (7:1-7:8, 33-40) [loose=false]
└─ paragraph[1] (7:3-7:8, 35-40)
└─ text: "Third" (7:3-7:8, 35-40)
Output AST:
root[2] (1:1-8:1, 0-41)
├─ heading[1] (2:1-2:8, 1-8) [depth=1]
│ └─ text: "Title" (2:3-2:8, 3-8)
└─ list[3] (4:1-7:8, 10-40) [ordered=false][loose=false][depth=0]
├─ listItem[1] (4:1-4:8, 10-17) [loose=false][index=0][ordered=false]
│ └─ paragraph[1] (4:3-4:8, 12-17)
│ └─ text: "First" (4:3-4:8, 12-17)
├─ listItem[2] (5:1-6:6, 18-32) [loose=false][index=1][ordered=false]
│ ├─ paragraph[1] (5:3-5:9, 20-26)
│ │ └─ text: "Second" (5:3-5:9, 20-26)
│ └─ list[1] (6:3-6:6, 29-32) [ordered=false][loose=false][depth=1]
│ └─ listItem[1] (6:3-6:6, 29-32) [loose=false][index=0][ordered=false]
│ └─ paragraph[1] (6:5-6:6, 31-32)
│ └─ text: "a" (6:5-6:6, 31-32)
└─ listItem[1] (7:1-7:8, 33-40) [loose=false][index=2][ordered=false]
└─ paragraph[1] (7:3-7:8, 35-40)
└─ text: "Third" (7:3-7:8, 35-40)
FAQs
Enhances the metadata of list and listItem nodes
The npm package mdast-add-list-metadata receives a total of 291,703 weekly downloads. As such, mdast-add-list-metadata popularity was classified as popular.
We found that mdast-add-list-metadata demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.