12
12
13
13
## Contents
14
14
15
- * [ What is this?] ( #what-is-this )
16
- * [ When should I use this?] ( #when-should-i-use-this )
17
- * [ Install] ( #install )
18
- * [ Use] ( #use )
19
- * [ API] ( #api )
20
- * [ ` toMdast(tree[, options]) ` ] ( #tomdasttree-options )
21
- * [ ` defaultHandlers ` ] ( #defaulthandlers )
22
- * [ ` defaultNodeHandlers ` ] ( #defaultnodehandlers )
23
- * [ ` Handle ` ] ( #handle )
24
- * [ ` NodeHandle ` ] ( #nodehandle )
25
- * [ ` Options ` ] ( #options )
26
- * [ ` State ` ] ( #state )
27
- * [ Examples] ( #examples )
28
- * [ Example: ignoring things] ( #example-ignoring-things )
29
- * [ Example: keeping some HTML] ( #example-keeping-some-html )
30
- * [ Algorithm] ( #algorithm )
31
- * [ Syntax] ( #syntax )
32
- * [ Syntax tree] ( #syntax-tree )
33
- * [ Types] ( #types )
34
- * [ Compatibility] ( #compatibility )
35
- * [ Security] ( #security )
36
- * [ Related] ( #related )
37
- * [ Contribute] ( #contribute )
38
- * [ License] ( #license )
15
+ * [ What is this?] ( #what-is-this )
16
+ * [ When should I use this?] ( #when-should-i-use-this )
17
+ * [ Install] ( #install )
18
+ * [ Use] ( #use )
19
+ * [ API] ( #api )
20
+ * [ ` toMdast(tree[, options]) ` ] ( #tomdasttree-options )
21
+ * [ ` defaultHandlers ` ] ( #defaulthandlers )
22
+ * [ ` defaultNodeHandlers ` ] ( #defaultnodehandlers )
23
+ * [ ` Handle ` ] ( #handle )
24
+ * [ ` NodeHandle ` ] ( #nodehandle )
25
+ * [ ` Options ` ] ( #options )
26
+ * [ ` State ` ] ( #state )
27
+ * [ Examples] ( #examples )
28
+ * [ Example: ignoring things] ( #example-ignoring-things )
29
+ * [ Example: keeping some HTML] ( #example-keeping-some-html )
30
+ * [ Algorithm] ( #algorithm )
31
+ * [ Syntax] ( #syntax )
32
+ * [ Syntax tree] ( #syntax-tree )
33
+ * [ Types] ( #types )
34
+ * [ Compatibility] ( #compatibility )
35
+ * [ Security] ( #security )
36
+ * [ Related] ( #related )
37
+ * [ Contribute] ( #contribute )
38
+ * [ License] ( #license )
39
39
40
40
## What is this?
41
41
@@ -119,10 +119,10 @@ Transform hast to mdast.
119
119
120
120
###### Parameters
121
121
122
- * ` tree ` ([ ` HastNode ` ] [ hast-node ] )
123
- — hast tree to transform
124
- * ` options ` ([ ` Options ` ] [ api-options ] , optional)
125
- — configuration
122
+ * ` tree ` ([ ` HastNode ` ] [ hast-node ] )
123
+ — hast tree to transform
124
+ * ` options ` ([ ` Options ` ] [ api-options ] , optional)
125
+ — configuration
126
126
127
127
###### Returns
128
128
@@ -146,12 +146,12 @@ Handle a particular element (TypeScript type).
146
146
147
147
###### Parameters
148
148
149
- * ` state ` ([ ` State ` ] [ api-state ] )
150
- — info passed around about the current state
151
- * ` element ` ([ ` Element ` ] [ element ] )
152
- — element to transform
153
- * ` parent ` ([ ` HastParent ` ] [ hast-parent ] )
154
- — parent of ` element `
149
+ * ` state ` ([ ` State ` ] [ api-state ] )
150
+ — info passed around about the current state
151
+ * ` element ` ([ ` Element ` ] [ element ] )
152
+ — element to transform
153
+ * ` parent ` ([ ` HastParent ` ] [ hast-parent ] )
154
+ — parent of ` element `
155
155
156
156
###### Returns
157
157
@@ -163,12 +163,12 @@ Handle a particular node (TypeScript type).
163
163
164
164
###### Parameters
165
165
166
- * ` state ` ([ ` State ` ] [ api-state ] )
167
- — info passed around about the current state
168
- * ` node ` (` any ` )
169
- — node to transform
170
- * ` parent ` ([ ` HastParent ` ] [ hast-parent ] )
171
- — parent of ` node `
166
+ * ` state ` ([ ` State ` ] [ api-state ] )
167
+ — info passed around about the current state
168
+ * ` node ` (` any ` )
169
+ — node to transform
170
+ * ` parent ` ([ ` HastParent ` ] [ hast-parent ] )
171
+ — parent of ` node `
172
172
173
173
###### Returns
174
174
@@ -245,34 +245,34 @@ Info passed around about the current state (TypeScript type).
245
245
246
246
###### Fields
247
247
248
- * ` patch ` (` (from: HastNode, to: MdastNode) => undefined ` )
249
- — copy a node’s positional info
250
- * ` one ` (` (node: HastNode, parent: HastParent | undefined) => Array<MdastNode> | MdastNode | undefined ` )
251
- — transform a hast node to mdast
252
- * ` all ` (` (parent: HastParent) => Array<MdastContent> ` )
253
- — transform the children of a hast parent to mdast
254
- * ` toFlow ` (` (nodes: Array<MdastContent>) => Array<MdastFlowContent> ` )
255
- — transform a list of mdast nodes to flow
256
- * ` toSpecificContent ` (` <ParentType>(nodes: Array<MdastContent>, build: (() => ParentType)) => Array<ParentType> ` )
257
- — turn arbitrary content into a list of a particular node type
258
- * ` resolve ` (` (url: string | null | undefined) => string ` )
259
- — resolve a URL relative to a base
260
- * ` options ` ([ ` Options ` ] [ api-options ] )
261
- — user configuration
262
- * ` elementById ` (` Map<string, Element> ` )
263
- — elements by their ` id `
264
- * ` handlers ` (` Record<string, Handle> ` )
265
- — applied element handlers (see [ ` Handle ` ] [ api-handle ] )
266
- * ` nodeHandlers ` (` Record<string, NodeHandle> ` )
267
- — applied node handlers (see [ ` NodeHandle ` ] [ api-node-handle ] )
268
- * ` baseFound ` (` boolean ` )
269
- — whether a ` <base> ` element was seen
270
- * ` frozenBaseUrl ` (` string | undefined ` )
271
- — ` href ` of ` <base> ` , if any
272
- * ` inTable ` (` boolean ` )
273
- — whether we’re in a table
274
- * ` qNesting ` (` number ` )
275
- — how deep we’re in ` <q> ` s
248
+ * ` patch ` (` (from: HastNode, to: MdastNode) => undefined ` )
249
+ — copy a node’s positional info
250
+ * ` one ` (` (node: HastNode, parent: HastParent | undefined) => Array<MdastNode> | MdastNode | undefined ` )
251
+ — transform a hast node to mdast
252
+ * ` all ` (` (parent: HastParent) => Array<MdastContent> ` )
253
+ — transform the children of a hast parent to mdast
254
+ * ` toFlow ` (` (nodes: Array<MdastContent>) => Array<MdastFlowContent> ` )
255
+ — transform a list of mdast nodes to flow
256
+ * ` toSpecificContent ` (` <ParentType>(nodes: Array<MdastContent>, build: (() => ParentType)) => Array<ParentType> ` )
257
+ — turn arbitrary content into a list of a particular node type
258
+ * ` resolve ` (` (url: string | null | undefined) => string ` )
259
+ — resolve a URL relative to a base
260
+ * ` options ` ([ ` Options ` ] [ api-options ] )
261
+ — user configuration
262
+ * ` elementById ` (` Map<string, Element> ` )
263
+ — elements by their ` id `
264
+ * ` handlers ` (` Record<string, Handle> ` )
265
+ — applied element handlers (see [ ` Handle ` ] [ api-handle ] )
266
+ * ` nodeHandlers ` (` Record<string, NodeHandle> ` )
267
+ — applied node handlers (see [ ` NodeHandle ` ] [ api-node-handle ] )
268
+ * ` baseFound ` (` boolean ` )
269
+ — whether a ` <base> ` element was seen
270
+ * ` frozenBaseUrl ` (` string | undefined ` )
271
+ — ` href ` of ` <base> ` , if any
272
+ * ` inTable ` (` boolean ` )
273
+ — whether we’re in a table
274
+ * ` qNesting ` (` number ` )
275
+ — how deep we’re in ` <q> ` s
276
276
277
277
## Examples
278
278
@@ -431,10 +431,10 @@ Use of `hast-util-to-mdast` is safe by default.
431
431
432
432
## Related
433
433
434
- * [ ` hast-util-to-nlcst ` ] ( https://github.com/syntax-tree/hast-util-to-nlcst )
435
- — transform hast to nlcst
436
- * [ ` hast-util-to-xast ` ] ( https://github.com/syntax-tree/hast-util-to-xast )
437
- — transform hast to xast
434
+ * [ ` hast-util-to-nlcst ` ] ( https://github.com/syntax-tree/hast-util-to-nlcst )
435
+ — transform hast to nlcst
436
+ * [ ` hast-util-to-xast ` ] ( https://github.com/syntax-tree/hast-util-to-xast )
437
+ — transform hast to xast
438
438
439
439
## Contribute
440
440
0 commit comments