Add support for parsing markdown by using .use(remarkParse) within a unified pipeline. This plugin turns markdown input into an mdast syntax tree.
To create a full pipeline (e.g., Markdown to HTML), you typically chain remark-parse with other plugins like remark-gfm (for GitHub Flavored Markdown), remark-rehype (to convert mdast to hast), and rehype-stringify (to serialize to HTML).
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 value = `
# 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(value)
console.log(String(file))