|
10 | 10 |
|
11 | 11 | **[mdast][]** utility to parse markdown.
|
12 | 12 |
|
| 13 | +## When to use this |
| 14 | + |
| 15 | +Use this if you want to use **[micromark][]** but need an AST. |
| 16 | +Use **[remark][]** instead, which includes both to provide a nice interface and |
| 17 | +hundreds of plugins. |
| 18 | + |
13 | 19 | ## Install
|
14 | 20 |
|
15 | 21 | This package is [ESM only](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c):
|
@@ -69,6 +75,11 @@ Now, running `node example` yields (positional info removed for brevity):
|
69 | 75 | This package exports the following identifier: `fromMarkdown`.
|
70 | 76 | There is no default export.
|
71 | 77 |
|
| 78 | +The export map supports the endorsed |
| 79 | +[`development` condition](https://nodejs.org/api/packages.html#packages_resolving_user_conditions). |
| 80 | +Run `node --conditions development module.js` to get instrumented dev code. |
| 81 | +Without this condition, production code is loaded. |
| 82 | + |
72 | 83 | ### `fromMarkdown(doc[, encoding][, options])`
|
73 | 84 |
|
74 | 85 | Parse markdown to a **[mdast][]** tree.
|
@@ -128,7 +139,7 @@ Array of mdast extensions (`Array.<MdastExtension>`, default: `[]`).
|
128 | 139 |
|
129 | 140 | ## Security
|
130 | 141 |
|
131 |
| -As Markdown is sometimes used for HTML, and improper use of HTML can open you up |
| 142 | +As markdown is sometimes used for HTML, and improper use of HTML can open you up |
132 | 143 | to a [cross-site scripting (XSS)][xss] attack, use of `mdast-util-from-markdown`
|
133 | 144 | can also be unsafe.
|
134 | 145 | When going to HTML, use this utility in combination with
|
@@ -209,4 +220,8 @@ abide by its terms.
|
209 | 220 |
|
210 | 221 | [sanitize]: https://github.com/syntax-tree/hast-util-sanitize
|
211 | 222 |
|
| 223 | +[micromark]: https://github.com/micromark/micromark |
| 224 | + |
212 | 225 | [micromark-extensions]: https://github.com/micromark/micromark#optionsextensions
|
| 226 | + |
| 227 | +[remark]: https://github.com/remarkjs/remark |
0 commit comments