1
- # hast-util-labelable [ ![ Build ] [ build-badge ]] [ build ] [ ![ Coverage ] [ coverage-badge ]] [ coverage ] [ ![ Downloads ] [ downloads-badge ]] [ downloads ] [ ![ Chat ] [ chat-badge ]] [ chat ]
1
+ # hast-util-labelable
2
2
3
- Check whether a [ HAST node] [ hast ] is [ labelable] [ spec ] .
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 ]
4
10
5
- ## Installation
11
+ [ ** hast** ] [ hast ] utility to check if an [ * element* ] [ element ] is
12
+ [ * labelable* ] [ spec ] .
13
+
14
+ ## Install
6
15
7
16
[ npm] [ ] :
8
17
9
- ``` bash
18
+ ``` sh
10
19
npm install hast-util-labelable
11
20
```
12
21
13
22
## Usage
14
23
15
- ``` javascript
24
+ ``` js
16
25
var labelable = require (' hast-util-labelable' )
17
26
18
27
labelable ({type: ' element' , tagName: ' div' }) // => false
@@ -30,24 +39,28 @@ labelable({
30
39
31
40
### ` labelable(node) `
32
41
42
+ Check if the given value is a [ * labelable* ] [ spec ] [ * element* ] [ element ] .
43
+
33
44
###### Parameters
34
45
35
- * ` node ` ([ ` Node ` ] [ node ] , optional) — Node to check.
46
+ * ` node ` (` * ` , optional) — Value to check, probably [ ` Node ` ] [ node ]
36
47
37
48
###### Returns
38
49
39
50
` boolean ` — Whether ` node ` is a labelable element.
40
51
Labelable nodes have a ` tagName ` set to ` button ` , ` keygen ` ,
41
52
` meter ` , ` output ` , ` progress ` , ` select ` , ` textarea ` , and ` input `
42
- (excluding ` [type=hidden] ` .
53
+ (excluding ` [type=hidden] ` ) .
43
54
44
55
## Contribute
45
56
46
- See [ ` contributing.md ` in ` syntax-tree/hast ` ] [ contributing ] for ways to get
57
+ See [ ` contributing.md ` in ` syntax-tree/.github ` ] [ contributing ] for ways to get
47
58
started.
59
+ See [ ` support.md ` ] [ support ] for ways to get help.
48
60
49
- This organisation has a [ Code of Conduct] [ coc ] . By interacting with this
50
- repository, organisation, or community you agree to abide by its terms.
61
+ This project has a [ Code of Conduct] [ coc ] .
62
+ By interacting with this repository, organisation, or community you agree to
63
+ abide by its terms.
51
64
52
65
## License
53
66
@@ -67,22 +80,36 @@ repository, organisation, or community you agree to abide by its terms.
67
80
68
81
[ downloads ] : https://www.npmjs.com/package/hast-util-labelable
69
82
83
+ [ size-badge ] : https://img.shields.io/bundlephobia/minzip/hast-util-labelable.svg
84
+
85
+ [ size ] : https://bundlephobia.com/result?p=hast-util-labelable
86
+
87
+ [ sponsors-badge ] : https://opencollective.com/unified/sponsors/badge.svg
88
+
89
+ [ backers-badge ] : https://opencollective.com/unified/backers/badge.svg
90
+
91
+ [ collective ] : https://opencollective.com/unified
92
+
70
93
[ chat-badge ] : https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg
71
94
72
- [ chat ] : https://spectrum.chat/unified/rehype
95
+ [ chat ] : https://spectrum.chat/unified/syntax-tree
73
96
74
97
[ npm ] : https://docs.npmjs.com/cli/install
75
98
76
99
[ license ] : license
77
100
78
101
[ author ] : https://wooorm.com
79
102
80
- [ hast ] : https://github.com/syntax-tree/hast
103
+ [ contributing ] : https://github.com/syntax-tree/.github/blob/master/contributing.md
104
+
105
+ [ support ] : https://github.com/syntax-tree/.github/blob/master/support.md
106
+
107
+ [ coc ] : https://github.com/syntax-tree/.github/blob/master/code-of-conduct.md
81
108
82
109
[ spec ] : https://html.spec.whatwg.org/#category-label
83
110
84
- [ node ] : https://github.com/syntax-tree/unist#node
111
+ [ hast ] : https://github.com/syntax-tree/hast
85
112
86
- [ contributing ] : https://github.com/syntax-tree/hast/blob/master/contributing.md
113
+ [ node ] : https://github.com/syntax-tree/hast#nodes
87
114
88
- [ coc ] : https://github.com/syntax-tree/hast/blob/master/code-of-conduct.md
115
+ [ element ] : https://github.com/syntax-tree/hast#element
0 commit comments