Gathering detailed insights and metrics for mdast-util-from-span-markdown
Gathering detailed insights and metrics for mdast-util-from-span-markdown
Gathering detailed insights and metrics for mdast-util-from-span-markdown
Gathering detailed insights and metrics for mdast-util-from-span-markdown
Minimalistic parser (TypeScript) for span elements written in markdown
npm install mdast-util-from-span-markdown
Typescript
Module System
Node Version
NPM Version
72.2
Supply Chain
98.9
Quality
75.6
Maintenance
100
Vulnerability
100
License
TypeScript (93.61%)
JavaScript (6.39%)
Total Downloads
5,154
Last Day
1
Last Week
15
Last Month
98
Last Year
885
MIT License
22 Commits
2 Watchers
1 Branches
1 Contributors
Updated on Oct 25, 2021
Minified
Minified + Gzipped
Latest Version
1.0.6
Package Id
mdast-util-from-span-markdown@1.0.6
Unpacked Size
21.86 kB
Size
6.99 kB
File Count
14
NPM Version
7.21.1
Node Version
16.9.0
Cumulative downloads
Total Downloads
The aim of this repo is to have a minimalistic parser (TypeScript) for span elements written in markdown syntax.
The output is an abstract syntax tree mostly compatible to mdast.
1npm i mdast-util-from-span-markdown
1import fromMarkdown from "mdast-util-from-span-markdown"; 2const md = "Say **Hello** [World](https://example.com) in `code`! *Thanks!*"; 3 4fromMarkdown(md);
1[ 2 { 3 type: "text", 4 value: "Say ", 5 }, 6 { 7 type: "strong", 8 children: [ 9 { 10 type: "text", 11 value: "Hello", 12 }, 13 ], 14 }, 15 { 16 type: "text", 17 value: " ", 18 }, 19 { 20 type: "link", 21 url: "https://example.com", 22 children: [ 23 { 24 type: "text", 25 value: "World", 26 }, 27 ], 28 }, 29 { 30 type: "text", 31 value: " in ", 32 }, 33 { 34 type: "inlineCode", 35 value: "code", 36 }, 37 { 38 type: "text", 39 value: "! ", 40 }, 41 { 42 type: "emphasis", 43 children: [ 44 { 45 type: "text", 46 value: "Thanks!", 47 }, 48 ], 49 }, 50];
Because this is not a full markdown parser (see remark otherwise) with support for block elements, this code is especially handy for «one-line markdown». Think for example about translations comming from a system that does not support rich text formatting.
If you like to render the output of fromMarkdown()
in a frontend-framework have a look at the examples/md.tsx
for react or examples/md.vue
for vue.
The examples are not included in the npm-package. You need to get a copy of the example and adjust it to your needs:
1# react 2curl https://raw.githubusercontent.com/signalwerk/mdast-util-from-span-markdown/main/examples/md.tsx > md.tsx 3 4# vue 5curl https://raw.githubusercontent.com/signalwerk/mdast-util-from-span-markdown/main/examples/md.vue > md.vue
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
no SAST tool detected
Details
Reason
Found 0/22 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
23 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreLast Day
0%
1
Compared to previous day
Last Week
-42.3%
15
Compared to previous week
Last Month
-3.9%
98
Compared to previous month
Last Year
1%
885
Compared to previous year