Skip to content

Commit 737a116

Browse files
committed
Refactor docs
1 parent 179df3a commit 737a116

File tree

1 file changed

+28
-18
lines changed

1 file changed

+28
-18
lines changed

readme.md

+28-18
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,24 @@ This package also supports embedded MDX nodes.
3535

3636
## When should I use this?
3737

38-
This project is useful when you want to deal with ASTs, and for some reason,
38+
This project is useful when you want to deal with ASTs,
39+
and for some reason,
3940
*have* to deal with XML.
4041
One example of this is for EPUB (digital books).
4142

42-
There is no inverse of this utility, because not all XML is HTML.
43+
There is no inverse of this utility,
44+
because not all XML is HTML.
4345

44-
A similar package, [`hast-util-to-estree`][github-hast-util-to-estree],
46+
A similar package,
47+
[`hast-util-to-estree`][github-hast-util-to-estree],
4548
can turn hast into estree (JavaScript) as JSX,
4649
which has some similarities to XML.
4750

4851
## Install
4952

5053
This package is [ESM only][github-gist-esm].
51-
In Node.js (version 16+), install with
52-
[npm][npmjs-install]:
54+
In Node.js (version 16+),
55+
install with [npm][npmjs-install]:
5356

5457
```sh
5558
npm install hast-util-to-xast
@@ -116,9 +119,11 @@ Turn a [hast][github-hast] tree into a [xast][github-xast] tree.
116119

117120
###### Parameters
118121

119-
* `tree` ([`HastNode`][github-hast-nodes])
122+
* `tree`
123+
([`HastNode`][github-hast-nodes])
120124
— hast tree to transform
121-
* `options` ([`Options`][api-options], optional)
125+
* `options`
126+
([`Options`][api-options], optional)
122127
— configuration
123128

124129
###### Returns
@@ -133,13 +138,15 @@ Configuration (TypeScript type).
133138

134139
###### `space`
135140

136-
Which space the document is in ([`Space`][api-space], default: `'html'`).
141+
Which space the document is in
142+
([`Space`][api-space], default: `'html'`).
137143

138-
When an `<svg>` element is found in the HTML space, this package already
139-
automatically switches to and from the SVG space when entering and exiting it.
144+
When an `<svg>` element is found in the HTML space,
145+
this package already automatically switches to and from the SVG space when
146+
entering and exiting it.
140147

141-
You can also switch explicitly with `xmlns` properties in hast, but note that
142-
only HTML and SVG are supported.
148+
You can also switch explicitly with `xmlns` properties in hast,
149+
but note that only HTML and SVG are supported.
143150

144151
### `Space`
145152

@@ -162,14 +169,16 @@ It exports the additional types [`Options`][api-options] and
162169
Projects maintained by the unified collective are compatible with maintained
163170
versions of Node.js.
164171
165-
When we cut a new major release, we drop support for unmaintained versions of
166-
Node.
167-
This means we try to keep the current release line, `hast-util-to-xast@^3`,
172+
When we cut a new major release,
173+
we drop support for unmaintained versions of Node.
174+
This means we try to keep the current release line,
175+
`hast-util-to-xast@3`,
168176
compatible with Node.js 16.
169177
170178
## Security
171179
172-
Both HTML and XML can be dangerous languages: don’t trust user-provided data.
180+
Both HTML and XML can be dangerous languages:
181+
don’t trust user-provided data.
173182
Use [`hast-util-santize`][github-hast-util-sanitize]
174183
to make the hast tree safe before using this utility.
175184
@@ -191,8 +200,9 @@ for ways to get started.
191200
See [`support.md`][health-support] for ways to get help.
192201
193202
This project has a [code of conduct][health-coc].
194-
By interacting with this repository, organization, or community you agree to
195-
abide by its terms.
203+
By interacting with this repository,
204+
organization,
205+
or community you agree to abide by its terms.
196206
197207
## License
198208

0 commit comments

Comments
 (0)