@@ -20,7 +20,6 @@ HTML) again, keeping positional info okay.
2020* [ API] ( #api )
2121 * [ ` raw(tree[, options]) ` ] ( #rawtree-options )
2222 * [ ` Options ` ] ( #options )
23- * [ ` Raw ` ] ( #raw )
2423* [ Types] ( #types )
2524* [ Compatibility] ( #compatibility )
2625* [ Security] ( #security )
@@ -39,7 +38,7 @@ it, while keeping the original data and positional info intact.
3938
4039This utility is particularly useful when coming from markdown and wanting to
4140support HTML embedded inside that markdown (which requires passing
42- ` allowDangerousHtml: true ` to ` mdast-util-to-hast ` ).
41+ ` allowDangerousHtml: true ` to [ ` mdast-util-to-hast ` ] [ mdast-util-to-hast ] ).
4342Markdown dictates how, say, a list item or emphasis can be parsed.
4443We can use that to turn the markdown syntax tree into an HTML syntax tree.
4544But markdown also dictates that things that look like HTML, are passed through
@@ -150,41 +149,13 @@ Configuration (TypeScript type).
150149* ` file ` ([ ` VFile ` ] [ vfile ] , optional)
151150 — corresponding virtual file representing the input document
152151
153- ### ` Raw `
154-
155- Interface of semistandard ` Raw ` nodes (TypeScript type).
156-
157- ###### Type
158-
159- ``` ts
160- export interface Raw extends Literal {
161- type: ' raw'
162- }
163- ```
164-
165152## Types
166153
167154This package is fully typed with [ TypeScript] [ ] .
168- It exports the additional types [ ` Options ` ] [ options ] and [ ` Raw ` ] [ raw-node ] .
169-
170- The types also register the ` Raw ` node type with ` @types/hast ` .
171- If you’re working with the syntax tree, make sure to import this utility
172- somewhere in your types, as that registers the new node types in the tree.
155+ It exports the additional type [ ` Options ` ] [ options ] .
173156
174- ``` js
175- /**
176- * @typedef {import('hast-util-raw')}
177- */
178-
179- import {visit } from ' unist-util-visit'
180-
181- /** @type {import('hast').Root} */
182- const tree = getHastNodeSomeHow ()
183-
184- visit (tree, function (node ) {
185- // `node` can now be a `raw` node.
186- })
187- ```
157+ The ` Raw ` node type is registered by and exposed from
158+ [ ` mdast-util-to-hast ` ] [ mdast-util-to-hast ] .
188159
189160## Compatibility
190161
@@ -215,7 +186,7 @@ Either do not use this utility in combination with user input, or use
215186
216187## Related
217188
218- * [ ` mdast-util-to-hast ` ] ( https://github.com/syntax-tree/ mdast-util-to-hast)
189+ * [ ` mdast-util-to-hast ` ] [ mdast-util-to-hast ]
219190 — transform mdast to hast
220191* [ ` rehype-raw ` ] ( https://github.com/rehypejs/rehype-raw )
221192 — rehype plugin
@@ -288,6 +259,8 @@ abide by its terms.
288259
289260[ node ] : https://github.com/syntax-tree/hast#nodes
290261
262+ [ mdast-util-to-hast ] : https://github.com/syntax-tree/mdast-util-to-hast
263+
291264[ hast-util-sanitize ] : https://github.com/syntax-tree/hast-util-sanitize
292265
293266[ vfile ] : https://github.com/vfile/vfile
@@ -299,5 +272,3 @@ abide by its terms.
299272[ raw ] : #rawtree-options
300273
301274[ options ] : #options
302-
303- [ raw-node ] : #raw
0 commit comments