8
8
[ ![ Backers] [ backers-badge ]] [ collective ]
9
9
[ ![ Chat] [ chat-badge ]] [ chat ]
10
10
11
- [ ** hast** ] [ hast ] utility to check if a [ * node* ] [ node ] is [ * phrasing* ] [ spec ]
12
- content.
11
+ [ hast] [ ] utility to check if a node is [ * phrasing* ] [ spec ] content.
13
12
14
- ## Install
13
+ ## Contents
14
+
15
+ * [ What is this?] ( #what-is-this )
16
+ * [ When should I use this?] ( #when-should-i-use-this )
17
+ * [ Install] ( #install )
18
+ * [ Use] ( #use )
19
+ * [ API] ( #api )
20
+ * [ ` phrasing(node) ` ] ( #phrasingnode )
21
+ * [ Types] ( #types )
22
+ * [ Compatibility] ( #compatibility )
23
+ * [ Security] ( #security )
24
+ * [ Related] ( #related )
25
+ * [ Contribute] ( #contribute )
26
+ * [ License] ( #license )
27
+
28
+ ## What is this?
15
29
16
- This package is [ ESM only ] ( https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c ) :
17
- Node 12+ is needed to use it and it must be ` import ` ed instead of ` require ` d .
30
+ This package is a small utility that checks if a node is phrasing content
31
+ according to HTML .
18
32
19
- [ npm] [ ] :
33
+ ## When should I use this?
34
+
35
+ This utility is super niche, if you’re here you probably know what you’re
36
+ looking for!
37
+
38
+ ## Install
39
+
40
+ This package is [ ESM only] [ esm ] .
41
+ In Node.js (version 12.20+, 14.14+, 16.0+, or 18.0+), install with [ npm] [ ] :
20
42
21
43
``` sh
22
44
npm install hast-util-phrasing
23
45
```
24
46
47
+ In Deno with [ ` esm.sh ` ] [ esmsh ] :
48
+
49
+ ``` js
50
+ import {phrasing } from ' https://esm.sh/hast-util-phrasing@2'
51
+ ```
52
+
53
+ In browsers with [ ` esm.sh ` ] [ esmsh ] :
54
+
55
+ ``` html
56
+ <script type =" module" >
57
+ import {phrasing } from ' https://esm.sh/hast-util-phrasing@2?bundle'
58
+ </script >
59
+ ```
60
+
25
61
## Use
26
62
27
63
``` js
@@ -60,7 +96,7 @@ phrasing({type: 'text', value: 'Delta'})
60
96
61
97
## API
62
98
63
- This package exports the following identifiers: ` phrasing ` .
99
+ This package exports the identifier ` phrasing ` .
64
100
There is no default export.
65
101
66
102
### ` phrasing(node) `
@@ -73,7 +109,19 @@ Check if the given value is [*phrasing*][spec] content.
73
109
74
110
###### Returns
75
111
76
- ` boolean ` — Whether ` node ` passes the test.
112
+ Whether ` node ` passes the test (` boolean ` ).
113
+
114
+ ## Types
115
+
116
+ This package is fully typed with [ TypeScript] [ ] .
117
+ It exports no additional types.
118
+
119
+ ## Compatibility
120
+
121
+ Projects maintained by the unified collective are compatible with all maintained
122
+ versions of Node.js.
123
+ As of now, that is Node.js 12.20+, 14.14+, 16.0+, and 18.0+.
124
+ Our projects sometimes work with older versions, but this is not guaranteed.
77
125
78
126
## Security
79
127
@@ -86,21 +134,21 @@ for [cross-site scripting (XSS)][xss] attacks.
86
134
— check if a node is a (certain) element
87
135
* [ ` hast-util-has-property ` ] ( https://github.com/syntax-tree/hast-util-has-property )
88
136
— check if a node has a property
89
- * [ ` hast-util-is-body-ok-link ` ] ( https://github.com/rehypejs/rehype-minify/tree/HEAD /packages/hast-util-is-body-ok-link )
137
+ * [ ` hast-util-is-body-ok-link ` ] ( https://github.com/rehypejs/rehype-minify/tree/main /packages/hast-util-is-body-ok-link )
90
138
— check if a node is “Body OK” link element
91
- * [ ` hast-util-is-conditional-comment ` ] ( https://github.com/rehypejs/rehype-minify/tree/HEAD /packages/hast-util-is-conditional-comment )
139
+ * [ ` hast-util-is-conditional-comment ` ] ( https://github.com/rehypejs/rehype-minify/tree/main /packages/hast-util-is-conditional-comment )
92
140
— check if a node is a conditional comment
93
- * [ ` hast-util-is-css-link ` ] ( https://github.com/rehypejs/rehype-minify/tree/HEAD /packages/hast-util-is-css-link )
141
+ * [ ` hast-util-is-css-link ` ] ( https://github.com/rehypejs/rehype-minify/tree/main /packages/hast-util-is-css-link )
94
142
— check if a node is a CSS link element
95
- * [ ` hast-util-is-css-style ` ] ( https://github.com/rehypejs/rehype-minify/tree/HEAD /packages/hast-util-is-css-style )
143
+ * [ ` hast-util-is-css-style ` ] ( https://github.com/rehypejs/rehype-minify/tree/main /packages/hast-util-is-css-style )
96
144
— check if a node is a CSS style element
97
145
* [ ` hast-util-embedded ` ] ( https://github.com/syntax-tree/hast-util-embedded )
98
146
— check if a node is an embedded element
99
147
* [ ` hast-util-heading ` ] ( https://github.com/syntax-tree/hast-util-heading )
100
148
— check if a node is a heading element
101
149
* [ ` hast-util-interactive ` ] ( https://github.com/syntax-tree/hast-util-interactive )
102
150
— check if a node is interactive
103
- * [ ` hast-util-is-javascript ` ] ( https://github.com/rehypejs/rehype-minify/tree/HEAD /packages/hast-util-is-javascript )
151
+ * [ ` hast-util-is-javascript ` ] ( https://github.com/rehypejs/rehype-minify/tree/main /packages/hast-util-is-javascript )
104
152
— check if a node is a JavaScript script element
105
153
* [ ` hast-util-labelable ` ] ( https://github.com/syntax-tree/hast-util-labelable )
106
154
— check whether a node is labelable
@@ -115,8 +163,8 @@ for [cross-site scripting (XSS)][xss] attacks.
115
163
116
164
## Contribute
117
165
118
- See [ ` contributing.md ` in ` syntax-tree/.github ` ] [ contributing ] for ways to get
119
- started.
166
+ See [ ` contributing.md ` ] [ contributing ] in [ ` syntax-tree/.github ` ] [ health ] for
167
+ ways to get started.
120
168
See [ ` support.md ` ] [ support ] for ways to get help.
121
169
122
170
This project has a [ code of conduct] [ coc ] .
@@ -157,15 +205,23 @@ abide by its terms.
157
205
158
206
[ npm ] : https://docs.npmjs.com/cli/install
159
207
208
+ [ esm ] : https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
209
+
210
+ [ esmsh ] : https://esm.sh
211
+
212
+ [ typescript ] : https://www.typescriptlang.org
213
+
160
214
[ license ] : license
161
215
162
216
[ author ] : https://wooorm.com
163
217
164
- [ contributing ] : https://github.com/syntax-tree/.github/blob/HEAD/contributing.md
218
+ [ health ] : https://github.com/syntax-tree/.github
219
+
220
+ [ contributing ] : https://github.com/syntax-tree/.github/blob/main/contributing.md
165
221
166
- [ support ] : https://github.com/syntax-tree/.github/blob/HEAD /support.md
222
+ [ support ] : https://github.com/syntax-tree/.github/blob/main /support.md
167
223
168
- [ coc ] : https://github.com/syntax-tree/.github/blob/HEAD /code-of-conduct.md
224
+ [ coc ] : https://github.com/syntax-tree/.github/blob/main /code-of-conduct.md
169
225
170
226
[ spec ] : https://html.spec.whatwg.org/#phrasing-content-2
171
227
0 commit comments