@@ -20,7 +20,6 @@ HTML) again, keeping positional info okay.
20
20
* [ API] ( #api )
21
21
* [ ` raw(tree[, options]) ` ] ( #rawtree-options )
22
22
* [ ` Options ` ] ( #options )
23
- * [ ` Raw ` ] ( #raw )
24
23
* [ Types] ( #types )
25
24
* [ Compatibility] ( #compatibility )
26
25
* [ Security] ( #security )
@@ -39,7 +38,7 @@ it, while keeping the original data and positional info intact.
39
38
40
39
This utility is particularly useful when coming from markdown and wanting to
41
40
support 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 ] ).
43
42
Markdown dictates how, say, a list item or emphasis can be parsed.
44
43
We can use that to turn the markdown syntax tree into an HTML syntax tree.
45
44
But markdown also dictates that things that look like HTML, are passed through
@@ -150,41 +149,13 @@ Configuration (TypeScript type).
150
149
* ` file ` ([ ` VFile ` ] [ vfile ] , optional)
151
150
— corresponding virtual file representing the input document
152
151
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
-
165
152
## Types
166
153
167
154
This 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 ] .
173
156
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 ] .
188
159
189
160
## Compatibility
190
161
@@ -215,7 +186,7 @@ Either do not use this utility in combination with user input, or use
215
186
216
187
## Related
217
188
218
- * [ ` mdast-util-to-hast ` ] ( https://github.com/syntax-tree/ mdast-util-to-hast)
189
+ * [ ` mdast-util-to-hast ` ] [ mdast-util-to-hast ]
219
190
— transform mdast to hast
220
191
* [ ` rehype-raw ` ] ( https://github.com/rehypejs/rehype-raw )
221
192
— rehype plugin
@@ -288,6 +259,8 @@ abide by its terms.
288
259
289
260
[ node ] : https://github.com/syntax-tree/hast#nodes
290
261
262
+ [ mdast-util-to-hast ] : https://github.com/syntax-tree/mdast-util-to-hast
263
+
291
264
[ hast-util-sanitize ] : https://github.com/syntax-tree/hast-util-sanitize
292
265
293
266
[ vfile ] : https://github.com/vfile/vfile
@@ -299,5 +272,3 @@ abide by its terms.
299
272
[ raw ] : #rawtree-options
300
273
301
274
[ options ] : #options
302
-
303
- [ raw-node ] : #raw
0 commit comments