1- # hast-util-whitespace [ ![ Build ] [ build-badge ]] [ build ] [ ![ Coverage ] [ coverage-badge ]] [ coverage ] [ ![ Downloads ] [ downloads-badge ]] [ downloads ] [ ![ Chat ] [ chat-badge ]] [ chat ]
1+ # hast-util-whitespace
22
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 ]
510
6- ## Installation
11+ [ ** hast** ] [ hast ] utility to check if a ` node ` is [ * inter-element
12+ whitespace* ] [ spec ] .
13+
14+ ## Install
715
816[ npm] [ ] :
917
10- ``` bash
18+ ``` sh
1119npm install hast-util-whitespace
1220```
1321
1422## Usage
1523
16- ``` javascript
24+ ``` js
1725var whitespace = require (' hast-util-whitespace' )
1826
1927whitespace ({
@@ -37,24 +45,29 @@ whitespace({
3745
3846### ` whitespace(node|value) `
3947
48+ Check if the given value is [ * inter-element whitespace* ] [ spec ] .
49+
4050###### Parameters
4151
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
4454
4555###### Returns
4656
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.
5061
5162## Contribute
5263
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
5465started.
66+ See [ ` support.md ` ] [ support ] for ways to get help.
5567
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.
5871
5972## License
6073
@@ -74,24 +87,36 @@ repository, organisation, or community you agree to abide by its terms.
7487
7588[ downloads ] : https://www.npmjs.com/package/hast-util-whitespace
7689
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+
77100[ chat-badge ] : https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg
78101
79- [ chat ] : https://spectrum.chat/unified/rehype
102+ [ chat ] : https://spectrum.chat/unified/syntax-tree
80103
81104[ npm ] : https://docs.npmjs.com/cli/install
82105
83106[ license ] : license
84107
85108[ author ] : https://wooorm.com
86109
87- [ hast ] : https://github.com/syntax-tree/hast
110+ [ contributing ] : https://github.com/syntax-tree/.github/blob/master/contributing.md
88111
89- [ spec ] : https://html.spec.whatwg.org/#inter-element-whitespace
112+ [ support ] : https://github.com/syntax-tree/.github/blob/master/support.md
90113
91- [ node ] : https://github.com/syntax-tree/unist#node
114+ [ coc ] : https://github.com/syntax-tree/.github/blob/master/code-of-conduct.md
92115
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
94119
95- [ contributing ] : https://github.com/syntax-tree/hast/blob/master/contributing.md
120+ [ node ] : https://github.com/syntax-tree/hast#nodes
96121
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