remark-parse
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
collapse-white-space | 1.0.6 | 2 kB | MIT | prod | |
is-alphabetical | 1.0.4 | 2.2 kB | MIT | prod | |
is-decimal | 1.0.4 | 2.12 kB | MIT | prod | |
is-whitespace-character | 1.0.4 | 2.26 kB | MIT | prod | |
is-word-character | 1.0.4 | 2.2 kB | MIT | prod | |
markdown-escapes | 1.0.4 | 2.32 kB | MIT | prod | |
parse-entities | 1.2.2 | 6.95 kB | MIT | prod | |
repeat-string | 1.6.1 | 3.26 kB | MIT | prod | |
state-toggle | 1.0.3 | 2.35 kB | MIT | prod | |
trim-trailing-lines | 1.1.4 | 2.06 kB | MIT | prod | |
trim | 0.0.1 | 1.55 kB | UNKNOWN | prod | 1 2 1 |
unherit | 1.1.3 | 2.46 kB | MIT | prod | |
unist-util-remove-position | 1.1.4 | 2.68 kB | MIT | prod | |
vfile-location | 2.0.6 | 3 kB | MIT | prod | |
xtend | 4.0.2 | 2.47 kB | MIT | prod |
Remark-parse is a highly capable JavaScript plugin for the unified system and part of the Remark ecosystem. It enhances unified by facilitating markdown parsing and transforming it into a syntax tree. This allows developers to handle markdown content flexibly and employ syntax extensions to add advanced features.
To install and use remark-parse, follow these steps:
npm install remark-parse
Here's an example :
import rehypeStringify from 'rehype-stringify'
import remarkGfm from 'remark-gfm'
import remarkParse from 'remark-parse'
import remarkRehype from 'remark-rehype'
import {unified} from 'unified'
const doc = `
# Mercury
**Mercury** is the first planet from the [Sun](https://en.wikipedia.org/wiki/Sun)
and the smallest planet in the Solar System.
`
const file = await unified()
.use(remarkParse)
.use(remarkGfm)
.use(remarkRehype)
.use(rehypeStringify)
.process(doc)
console.log(String(file))
Running this script will transform your markdown into HTML.
The official documentation of remark-parse can be found on GitHub at https://github.com/remarkjs/remark/tree/main/packages/remark-parse
. The repository's README file provides a detailed explanation about the plugin and its usage. Its vast ecosystem, along with the plethora of examples provided, make it an instrumental tool in markdown handling.