1
- # hast-util-whitespace [ ![ Build ] [ build-badge ]] [ build ] [ ![ Coverage ] [ coverage-badge ]] [ coverage ] [ ![ Downloads ] [ downloads-badge ]] [ downloads ] [ ![ Chat ] [ chat-badge ]] [ chat ]
1
+ # hast-util-whitespace
2
2
3
- Check whether a [ HAST node] [ hast ] is [ ** inter-element
4
- whitespace** ] [ 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 ]
5
10
6
- ## Installation
11
+ [ ** hast** ] [ hast ] utility to check if a ` node ` is [ * inter-element
12
+ whitespace* ] [ spec ] .
13
+
14
+ ## Install
7
15
8
16
[ npm] [ ] :
9
17
10
- ``` bash
18
+ ``` sh
11
19
npm install hast-util-whitespace
12
20
```
13
21
14
22
## Usage
15
23
16
- ``` javascript
24
+ ``` js
17
25
var whitespace = require (' hast-util-whitespace' )
18
26
19
27
whitespace ({
@@ -37,24 +45,29 @@ whitespace({
37
45
38
46
### ` whitespace(node|value) `
39
47
48
+ Check if the given value is [ * inter-element whitespace* ] [ spec ] .
49
+
40
50
###### Parameters
41
51
42
- * ` node ` ([ ` Node ` ] [ node ] , optional) — Node whose ` value ` to check.
43
- * ` value ` (` string ` , optional) — Value to check.
52
+ * ` node ` ([ ` Node ` ] [ node ] , optional) — Node to check
53
+ * ` value ` (` string ` , optional) — Value to check
44
54
45
55
###### Returns
46
56
47
- ` boolean ` — Whether the ` value ` (of [ ` node ` ] [ text ] ) is inter-element
48
- white-space: consisting of zero or more of space, tab (` \t ` ),
49
- line feed (` \n ` ), carriage return (` \r ` ), or form feed (` \f ` ).
57
+ ` boolean ` — Whether the ` value ` is inter-element white-space: consisting of zero
58
+ or more of space, tab (` \t ` ), line feed (` \n ` ), carriage return (` \r ` ), or form
59
+ feed (` \f ` ).
60
+ If ` node ` is passed it must be a [ * text* ] [ text ] node.
50
61
51
62
## Contribute
52
63
53
- See [ ` contributing.md ` in ` syntax-tree/hast ` ] [ contributing ] for ways to get
64
+ See [ ` contributing.md ` in ` syntax-tree/.github ` ] [ contributing ] for ways to get
54
65
started.
66
+ See [ ` support.md ` ] [ support ] for ways to get help.
55
67
56
- This organisation has a [ Code of Conduct] [ coc ] . By interacting with this
57
- repository, organisation, or community you agree to abide by its terms.
68
+ This project has a [ Code of Conduct] [ coc ] .
69
+ By interacting with this repository, organisation, or community you agree to
70
+ abide by its terms.
58
71
59
72
## License
60
73
@@ -74,24 +87,36 @@ repository, organisation, or community you agree to abide by its terms.
74
87
75
88
[ downloads ] : https://www.npmjs.com/package/hast-util-whitespace
76
89
90
+ [ size-badge ] : https://img.shields.io/bundlephobia/minzip/hast-util-whitespace.svg
91
+
92
+ [ size ] : https://bundlephobia.com/result?p=hast-util-whitespace
93
+
94
+ [ sponsors-badge ] : https://opencollective.com/unified/sponsors/badge.svg
95
+
96
+ [ backers-badge ] : https://opencollective.com/unified/backers/badge.svg
97
+
98
+ [ collective ] : https://opencollective.com/unified
99
+
77
100
[ chat-badge ] : https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg
78
101
79
- [ chat ] : https://spectrum.chat/unified/rehype
102
+ [ chat ] : https://spectrum.chat/unified/syntax-tree
80
103
81
104
[ npm ] : https://docs.npmjs.com/cli/install
82
105
83
106
[ license ] : license
84
107
85
108
[ author ] : https://wooorm.com
86
109
87
- [ hast ] : https://github.com/syntax-tree/hast
110
+ [ contributing ] : https://github.com/syntax-tree/.github/blob/master/contributing.md
88
111
89
- [ spec ] : https://html.spec.whatwg.org/#inter-element-whitespace
112
+ [ support ] : https://github.com/syntax-tree/.github/blob/master/support.md
90
113
91
- [ node ] : https://github.com/syntax-tree/unist#node
114
+ [ coc ] : https://github.com/syntax-tree/.github/blob/master/code-of-conduct.md
92
115
93
- [ text ] : https://github.com/syntax-tree/unist#text
116
+ [ hast ] : https://github.com/syntax-tree/hast
117
+
118
+ [ spec ] : https://html.spec.whatwg.org/#inter-element-whitespace
94
119
95
- [ contributing ] : https://github.com/syntax-tree/hast/blob/master/contributing.md
120
+ [ node ] : https://github.com/syntax-tree/hast#nodes
96
121
97
- [ coc ] : https://github.com/syntax-tree/hast/blob/master/code-of-conduct.md
122
+ [ text ] : https://github.com/syntax-tree/hast#text
0 commit comments