Skip to content

Commit 8b80cd4

Browse files
committed
Refactor prose
1 parent 9cec706 commit 8b80cd4

File tree

1 file changed

+46
-20
lines changed

1 file changed

+46
-20
lines changed

readme.md

+46-20
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
1-
# hast-util-is-element [![Build][build-badge]][build] [![Coverage][coverage-badge]][coverage] [![Downloads][downloads-badge]][downloads] [![Chat][chat-badge]][chat]
1+
# hast-util-is-element
22

3-
Check if a [node][] is a (certain) [**HAST**][hast] [element][].
3+
[![Build][build-badge]][build]
4+
[![Coverage][coverage-badge]][coverage]
5+
[![Downloads][downloads-badge]][downloads]
6+
[![Size][size-badge]][size]
7+
[![Sponsors][sponsors-badge]][collective]
8+
[![Backers][backers-badge]][collective]
9+
[![Chat][chat-badge]][chat]
410

5-
## Installation
11+
[**hast**][hast] utility to check if a [*node*][node] is a (certain)
12+
[*element*][element].
13+
14+
## Install
615

716
[npm][]:
817

9-
```bash
18+
```sh
1019
npm install hast-util-is-element
1120
```
1221

1322
## Usage
1423

15-
```javascript
24+
```js
1625
var is = require('hast-util-is-element')
1726

1827
is({type: 'text', value: 'foo'}) // => false
@@ -26,17 +35,20 @@ is({type: 'element', tagName: 'a'}, ['a', 'area']) // => true
2635

2736
### `isElement(node[, tagName|tagNames])`
2837

29-
Check if a [node][] is a (certain) [**HAST**][hast] [element][].
38+
Check if the given value is a (certain) [*element*][element].
3039

31-
When not given a second parameter, asserts if `node` is an element,
32-
otherwise asserts `node` is an element whose `tagName` matches / is
33-
included in the second parameter.
40+
* When given a `tagName` or `tagNames`, checks that `node` is an
41+
[*element*][element] whose `tagName` field matches `tagName` or is included
42+
in `tagNames`
43+
* Otherwise checks that `node` is an [*element*][element]
3444

3545
###### Parameters
3646

37-
* `node` (`*`) — Value to check;
38-
* `tagName` (`string`, optional) — Value `node`s `tagName` must match;
39-
* `tagNames` (`Array.<string>`, optional) — Value including `node`s `tagName`.
47+
* `node` (`*`) — Value to check, probably [`Node`][node]
48+
* `tagName` (`string`, optional) — Value that `node`s `tagName` field should
49+
match
50+
* `tagNames` (`Array.<string>`, optional) — Values that should include `node`s
51+
`tagName` field should match
4052

4153
###### Returns
4254

@@ -48,11 +60,13 @@ included in the second parameter.
4860

4961
## Contribute
5062

51-
See [`contributing.md` in `syntax-tree/hast`][contributing] for ways to get
63+
See [`contributing.md` in `syntax-tree/.github`][contributing] for ways to get
5264
started.
65+
See [`support.md`][support] for ways to get help.
5366

54-
This organisation has a [Code of Conduct][coc]. By interacting with this
55-
repository, organisation, or community you agree to abide by its terms.
67+
This project has a [Code of Conduct][coc].
68+
By interacting with this repository, organisation, or community you agree to
69+
abide by its terms.
5670

5771
## License
5872

@@ -72,22 +86,34 @@ repository, organisation, or community you agree to abide by its terms.
7286

7387
[downloads]: https://www.npmjs.com/package/hast-util-is-element
7488

89+
[size-badge]: https://img.shields.io/bundlephobia/minzip/hast-util-is-element.svg
90+
91+
[size]: https://bundlephobia.com/result?p=hast-util-is-element
92+
93+
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
94+
95+
[backers-badge]: https://opencollective.com/unified/backers/badge.svg
96+
97+
[collective]: https://opencollective.com/unified
98+
7599
[chat-badge]: https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg
76100

77-
[chat]: https://spectrum.chat/unified/rehype
101+
[chat]: https://spectrum.chat/unified/syntax-tree
78102

79103
[npm]: https://docs.npmjs.com/cli/install
80104

81105
[license]: license
82106

83107
[author]: https://wooorm.com
84108

109+
[contributing]: https://github.com/syntax-tree/.github/blob/master/contributing.md
110+
111+
[support]: https://github.com/syntax-tree/.github/blob/master/support.md
112+
113+
[coc]: https://github.com/syntax-tree/.github/blob/master/code-of-conduct.md
114+
85115
[hast]: https://github.com/syntax-tree/hast
86116

87117
[node]: https://github.com/syntax-tree/unist#node
88118

89119
[element]: https://github.com/syntax-tree/hast#element
90-
91-
[contributing]: https://github.com/syntax-tree/hast/blob/master/contributing.md
92-
93-
[coc]: https://github.com/syntax-tree/hast/blob/master/code-of-conduct.md

0 commit comments

Comments
 (0)