@@ -47,7 +47,7 @@ hast into estree (JavaScript) as JSX, which has some similarities to XML.
47
47
## Install
48
48
49
49
This package is [ ESM only] [ esm ] .
50
- In Node.js (version 14.14+ and or 16.0 +), install with [ npm] [ ] :
50
+ In Node.js (version 16 +), install with [ npm] [ ] :
51
51
52
52
``` sh
53
53
npm install hast-util-to-xast
@@ -105,7 +105,7 @@ console.log(toXml(xast))
105
105
106
106
## API
107
107
108
- This package exports the identifier [ ` toXast ` ] [ toxast ] .
108
+ This package exports the identifier [ ` toXast ` ] [ api-to-xast ] .
109
109
There is no default export.
110
110
111
111
### ` toXast(tree[, options]) `
@@ -116,7 +116,7 @@ Turn a [hast][] tree into a [xast][] tree.
116
116
117
117
* ` tree ` ([ ` HastNode ` ] [ hast-node ] )
118
118
— hast tree to transform
119
- * ` options ` ([ ` Options ` ] [ options ] , optional)
119
+ * ` options ` ([ ` Options ` ] [ api- options] , optional)
120
120
— configuration
121
121
122
122
###### Returns
@@ -131,7 +131,7 @@ Configuration (TypeScript type).
131
131
132
132
###### ` space `
133
133
134
- Which space the document is in.
134
+ Which space the document is in ( [ ` Space ` ] [ api-space ] , default: ` 'html' ` ) .
135
135
136
136
When an ` <svg> ` element is found in the HTML space, this package already
137
137
automatically switches to and from the SVG space when entering and exiting it.
@@ -152,14 +152,18 @@ type Space = 'html' | 'svg'
152
152
## Types
153
153
154
154
This package is fully typed with [TypeScript][].
155
- It exports the additional types [ ` Options ` ][options] and [ ` Space ` ][space].
155
+ It exports the additional types [ ` Options ` ][api-options] and
156
+ [ ` Space ` ][api-space].
156
157
157
158
## Compatibility
158
159
159
- Projects maintained by the unified collective are compatible with all maintained
160
+ Projects maintained by the unified collective are compatible with maintained
160
161
versions of Node.js.
161
- As of now, that is Node.js 14.14+ and 16.0+.
162
- Our projects sometimes work with older versions, but this is not guaranteed.
162
+
163
+ When we cut a new major release, we drop support for unmaintained versions of
164
+ Node.
165
+ This means we try to keep the current release line, ` hast -util -to -xast @^2 ` ,
166
+ compatible with Node.js 12.
163
167
164
168
## Security
165
169
@@ -204,9 +208,9 @@ abide by its terms.
204
208
205
209
[downloads]: https://www.npmjs.com/package/hast-util-to-xast
206
210
207
- [size-badge]: https://img.shields.io/bundlephobia/minzip/ hast-util-to-xast.svg
211
+ [size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q= hast-util-to-xast
208
212
209
- [size]: https://bundlephobia .com/result?p =hast-util-to-xast
213
+ [size]: https://bundlejs .com/?q =hast-util-to-xast
210
214
211
215
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
212
216
@@ -250,8 +254,8 @@ abide by its terms.
250
254
251
255
[xast-node]: https://github.com/syntax-tree/xast#nodes
252
256
253
- [toxast ]: #toxasttree-options
257
+ [api-to-xast ]: #toxasttree-options
254
258
255
- [options]: #options
259
+ [api- options]: #options
256
260
257
- [space]: #space-1
261
+ [api- space]: #space-1
0 commit comments