@@ -44,7 +44,8 @@ utility and `parse5` to both parse HTML and generate hast from it.
44
44
## Install
45
45
46
46
This package is [ ESM only] [ github-gist-esm ] .
47
- In Node.js (version 16+), install with [ npm] [ npmjs-install ] :
47
+ In Node.js (version 16+),
48
+ install with [ npm] [ npmjs-install ] :
48
49
49
50
``` sh
50
51
npm install hast-util-from-parse5
@@ -120,9 +121,11 @@ Transform a `parse5` AST to hast.
120
121
121
122
###### Parameters
122
123
123
- * ` tree ` ([ ` Parse5Node ` ] [ github-parse5-node ] )
124
+ * ` tree `
125
+ ([ ` Parse5Node ` ] [ github-parse5-node ] )
124
126
— ` parse5 ` tree to transform
125
- * ` options ` ([ ` Options ` ] [ api-options ] , optional)
127
+ * ` options `
128
+ ([ ` Options ` ] [ api-options ] , optional)
126
129
— configuration
127
130
128
131
###### Returns
@@ -140,22 +143,27 @@ Configuration (TypeScript type).
140
143
File used to add positional info to nodes
141
144
([ ` VFile ` ] [ github-vfile ] , optional).
142
145
143
- If given, the file should represent the original HTML source.
146
+ If given,
147
+ the file should represent the original HTML source.
144
148
145
149
###### ` space `
146
150
147
- Which space the document is in ([ ` Space ` ] [ api-space ] , default: ` 'html' ` ).
151
+ Which space the document is in
152
+ ([ ` Space ` ] [ api-space ] , default: ` 'html' ` ).
148
153
149
- When an ` <svg> ` element is found in the HTML space, this package already
150
- automatically switches to and from the SVG space when entering and exiting
151
- it.
154
+ When an ` <svg> ` element is found in the HTML space,
155
+ this package already automatically switches to and from the SVG space when
156
+ entering and exiting it.
152
157
153
158
###### ` verbose `
154
159
155
- Whether to add extra positional info about starting tags, closing tags,
156
- and attributes to elements (` boolean ` , default: ` false ` ).
160
+ Whether to add extra positional info about starting tags,
161
+ closing tags,
162
+ and attributes to elements
163
+ (` boolean ` , default: ` false ` ).
157
164
158
- > 👉 ** Note** : only used when ` file ` is given.
165
+ > 👉 ** Note** :
166
+ > only used when ` file ` is given.
159
167
160
168
For the following HTML:
161
169
@@ -222,9 +230,10 @@ It exports the additional types [`Options`][api-options] and
222
230
Projects maintained by the unified collective are compatible with maintained
223
231
versions of Node.js.
224
232
225
- When we cut a new major release, we drop support for unmaintained versions of
226
- Node.
227
- This means we try to keep the current release line, ` hast -util -from -parse5 @^8 ` ,
233
+ When we cut a new major release,
234
+ we drop support for unmaintained versions of Node.
235
+ This means we try to keep the current release line,
236
+ ` hast -util -from -parse5 @8 ` ,
228
237
compatible with Node.js 16.
229
238
230
239
## Security
@@ -256,8 +265,9 @@ for ways to get started.
256
265
See [ ` support .md ` ][health-support] for ways to get help.
257
266
258
267
This project has a [code of conduct][health-coc].
259
- By interacting with this repository, organization, or community you agree to
260
- abide by its terms.
268
+ By interacting with this repository,
269
+ organization,
270
+ or community you agree to abide by its terms.
261
271
262
272
## License
263
273
0 commit comments