Skip to content

Commit f2c1c9c

Browse files
committed
Refactor docs
1 parent c768728 commit f2c1c9c

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

readme.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ looking for!
3838
## Install
3939

4040
This package is [ESM only][esm].
41-
In Node.js (version 14.14+ and 16.0+), install with [npm][]:
41+
In Node.js (version 16+), install with [npm][]:
4242

4343
```sh
4444
npm install hast-util-whitespace
@@ -83,7 +83,7 @@ whitespace({
8383

8484
## API
8585

86-
This package exports the identifier [`whitespace`][whitespace].
86+
This package exports the identifier [`whitespace`][api-whitespace].
8787
There is no default export.
8888

8989
### `whitespace(thing)`
@@ -110,10 +110,13 @@ It exports no additional types.
110110

111111
## Compatibility
112112

113-
Projects maintained by the unified collective are compatible with all maintained
113+
Projects maintained by the unified collective are compatible with maintained
114114
versions of Node.js.
115-
As of now, that is Node.js 14.14+ and 16.0+.
116-
Our projects sometimes work with older versions, but this is not guaranteed.
115+
116+
When we cut a new major release, we drop support for unmaintained versions of
117+
Node.
118+
This means we try to keep the current release line, `hast-util-whitespace@^2`,
119+
compatible with Node.js 12.
117120

118121
## Security
119122

@@ -144,7 +147,7 @@ for [cross-site scripting (XSS)][xss] attacks.
144147
— check if a node is a script-supporting element
145148
* [`hast-util-is-body-ok-link`](https://github.com/rehypejs/rehype-minify/tree/main/packages/hast-util-is-body-ok-link)
146149
— check if a node is “Body OK” link element
147-
* [`hast-util-is-conditional-comment`](https://github.com/rehypejs/rehype-minify/tree/HEAD/packages/hast-util-is-conditional-comment)
150+
* [`hast-util-is-conditional-comment`](https://github.com/rehypejs/rehype-minify/tree/main/packages/hast-util-is-conditional-comment)
148151
— check if a node is a conditional comment
149152
* [`hast-util-is-css-link`](https://github.com/rehypejs/rehype-minify/tree/main/packages/hast-util-is-css-link)
150153
— check if a node is a CSS link element
@@ -181,9 +184,9 @@ abide by its terms.
181184

182185
[downloads]: https://www.npmjs.com/package/hast-util-whitespace
183186

184-
[size-badge]: https://img.shields.io/bundlephobia/minzip/hast-util-whitespace.svg
187+
[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=hast-util-whitespace
185188

186-
[size]: https://bundlephobia.com/result?p=hast-util-whitespace
189+
[size]: https://bundlejs.com/?q=hast-util-whitespace
187190

188191
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
189192

@@ -225,4 +228,4 @@ abide by its terms.
225228

226229
[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting
227230

228-
[whitespace]: #whitespacething
231+
[api-whitespace]: #whitespacething

test.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,12 @@ test('whitespace', async function (t) {
1313
assert.equal(whitespace({type: 'comment', value: 'asd'}), false)
1414
})
1515

16-
await t.test(
17-
'should return `false` for other white-space',
18-
async function () {
19-
assert.equal(whitespace({type: 'text', value: '\v'}), false)
20-
}
21-
)
16+
await t.test('should return `false` for other whitespace', async function () {
17+
assert.equal(whitespace({type: 'text', value: '\v'}), false)
18+
})
2219

2320
await t.test(
24-
'should return `true` for inter-element white-space',
21+
'should return `true` for inter-element whitespace',
2522
async function () {
2623
assert.equal(whitespace({type: 'text', value: ' \t\r\n\f'}), true)
2724
}
@@ -35,7 +32,7 @@ test('whitespace', async function (t) {
3532
)
3633

3734
await t.test(
38-
'should return `true` for a `string` of inter-element white-space',
35+
'should return `true` for a `string` of inter-element whitespace',
3936
async function () {
4037
assert.equal(whitespace(' \t\r\n\f'), true)
4138
}

0 commit comments

Comments
 (0)