8
8
[ ![ Backers] [ backers-badge ]] [ collective ]
9
9
[ ![ Chat] [ chat-badge ]] [ chat ]
10
10
11
- [ hast] [ ] utility to generate [ ` parse5 ` ] [ parse5 ] s [ AST] [ parse5-node ] .
11
+ [ hast] [ ] utility to transform to a [ ` parse5 ` ] [ parse5 ] [ AST] [ parse5-node ] .
12
12
13
13
## Contents
14
14
29
29
30
30
## What is this?
31
31
32
- This package is a utility that can turn a hast syntax tree into ` parse5 ` s AST.
32
+ This package is a utility that can turn a hast syntax tree into a ` parse5 ` AST.
33
33
Why not use a Parse5 adapter, you might ask?
34
34
Well, because it’s more code weight to use adapters, and more fragile.
35
35
@@ -43,7 +43,7 @@ likely what you want.
43
43
## Install
44
44
45
45
This package is [ ESM only] [ esm ] .
46
- In Node.js (version 14.14+ and 16.0 +), install with [ npm] [ ] :
46
+ In Node.js (version 16 +), install with [ npm] [ ] :
47
47
48
48
``` sh
49
49
npm install hast-util-to-parse5
@@ -90,18 +90,18 @@ Yields:
90
90
91
91
## API
92
92
93
- This package exports the identifier [ ` toParse5 ` ] [ toparse5 ] .
93
+ This package exports the identifier [ ` toParse5 ` ] [ api-to-parse5 ] .
94
94
There is no default export.
95
95
96
96
### ` toParse5(tree[, options]) `
97
97
98
- Transform a hast tree to Parse5’s AST.
98
+ Transform a hast tree to a ` parse5 ` AST.
99
99
100
100
###### Parameters
101
101
102
102
* ` tree ` ([ ` HastNode ` ] [ hast-node ] )
103
103
— tree to transform
104
- * ` options ` ([ ` Options ` ] [ options ] , optional)
104
+ * ` options ` ([ ` Options ` ] [ api- options] , optional)
105
105
— configuration
106
106
107
107
###### Returns
@@ -114,7 +114,7 @@ Configuration (TypeScript type).
114
114
115
115
###### Fields
116
116
117
- * ` space ` ([ ` Space ` ] [ space ] , optional)
117
+ * ` space ` ([ ` Space ` ] [ api- space] , optional)
118
118
— which space the document is in
119
119
120
120
### ` Space `
@@ -130,14 +130,18 @@ type Space = 'html' | 'svg'
130
130
## Types
131
131
132
132
This package is fully typed with [TypeScript][].
133
- It exports the additional types [ ` Options ` ][options] and [ ` Space ` ][space].
133
+ It exports the additional types [ ` Options ` ][api-options] and
134
+ [ ` Space ` ][api-space].
134
135
135
136
## Compatibility
136
137
137
- Projects maintained by the unified collective are compatible with all maintained
138
+ Projects maintained by the unified collective are compatible with maintained
138
139
versions of Node.js.
139
- As of now, that is Node.js 14.14+ and 16.0+.
140
- Our projects sometimes work with older versions, but this is not guaranteed.
140
+
141
+ When we cut a new major release, we drop support for unmaintained versions of
142
+ Node.
143
+ This means we try to keep the current release line, ` hast -util -to -parse5 @^7 ` ,
144
+ compatible with Node.js 12.
141
145
142
146
## Security
143
147
@@ -187,9 +191,9 @@ abide by its terms.
187
191
188
192
[downloads]: https://www.npmjs.com/package/hast-util-to-parse5
189
193
190
- [size-badge]: https://img.shields.io/bundlephobia/minzip/ hast-util-to-parse5.svg
194
+ [size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q= hast-util-to-parse5
191
195
192
- [size]: https://bundlephobia .com/result?p =hast-util-to-parse5
196
+ [size]: https://bundlejs .com/?q =hast-util-to-parse5
193
197
194
198
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
195
199
@@ -233,8 +237,8 @@ abide by its terms.
233
237
234
238
[hast-util-from-parse5]: https://github.com/syntax-tree/hast-util-from-parse5
235
239
236
- [toparse5 ]: #toparse5tree-options
240
+ [api-to-parse5 ]: #toparse5tree-options
237
241
238
- [options]: #options
242
+ [api- options]: #options
239
243
240
- [space]: #space
244
+ [api- space]: #space
0 commit comments