@@ -18,8 +18,8 @@ HTML) again, keeping positional info okay.
18
18
* [ Install] ( #install )
19
19
* [ Use] ( #use )
20
20
* [ API] ( #api )
21
- * [ ` raw(tree[, options]) ` ] ( #rawtree-options )
22
21
* [ ` Options ` ] ( #options )
22
+ * [ ` raw(tree, options) ` ] ( #rawtree-options )
23
23
* [ Types] ( #types )
24
24
* [ Compatibility] ( #compatibility )
25
25
* [ Security] ( #security )
@@ -117,37 +117,36 @@ Yields:
117
117
118
118
## API
119
119
120
- This package exports the identifier [ ` raw ` ] [ api-raw ] .
121
- There is no default export.
120
+ ### ` Options `
122
121
123
- ### ` raw(tree[, options]) `
122
+ Configuration.
124
123
125
- Pass a hast tree through an HTML parser, which will fix nesting, and turn raw
126
- nodes into actual nodes.
124
+ ###### Fields
127
125
128
- ###### Parameters
126
+ * ` file? ` (` VFile | null | undefined ` )
127
+ — corresponding virtual file representing the input document (optional)
128
+ * ` passThrough? ` (` Array<string> | null | undefined ` )
129
129
130
- * ` tree ` ([ ` Node ` ] [ node ] )
131
- — original hast tree to transform
132
- * ` options ` ([ ` Options ` ] [ api-options ] , optional)
133
- — configuration
130
+ List of custom hast node types to pass through (as in, keep) (optional).
134
131
135
- ###### Returns
132
+ If the passed through nodes have children, those children are expected to
133
+ be hast again and will be handled.
136
134
137
- Parsed again tree ( [ ` Node ` ] [ node ] ).
135
+ ### ` raw( tree, options) `
138
136
139
- ### ` Options `
137
+ Pass a hast tree through an HTML parser, which will fix nesting, and turn
138
+ raw nodes into actual nodes.
139
+
140
+ ###### Parameters
140
141
141
- Configuration (TypeScript type).
142
+ * ` tree ` (` Root | RootContent ` )
143
+ — original hast tree to transform
144
+ * ` options? ` (` Options | null | undefined ` )
145
+ — configuration (optional)
142
146
143
- ###### Fields
147
+ ###### Returns
144
148
145
- * ` passThrough ` (` Array<string> ` , optional)
146
- — list of custom hast node types to pass through (keep).
147
- If the passed through nodes have children, those children are expected to be
148
- hast and will be handled by this utility
149
- * ` file ` ([ ` VFile ` ] [ vfile ] , optional)
150
- — corresponding virtual file representing the input document
149
+ Parsed again tree (` Root | RootContent ` ).
151
150
152
151
## Types
153
152
@@ -260,18 +259,12 @@ abide by its terms.
260
259
261
260
[ hast ] : https://github.com/syntax-tree/hast
262
261
263
- [ node ] : https://github.com/syntax-tree/hast#nodes
264
-
265
262
[ mdast-util-to-hast ] : https://github.com/syntax-tree/mdast-util-to-hast
266
263
267
264
[ hast-util-sanitize ] : https://github.com/syntax-tree/hast-util-sanitize
268
265
269
- [ vfile ] : https://github.com/vfile/vfile
270
-
271
266
[ rehype-raw ] : https://github.com/rehypejs/rehype-raw
272
267
273
268
[ parse5 ] : https://github.com/inikulin/parse5
274
269
275
- [ api-raw ] : #rawtree-options
276
-
277
270
[ api-options ] : #options
0 commit comments