11# hast-util-script-supporting [ ![ Build Status] [ build-badge ]] [ build-page ] [ ![ Coverage Status] [ coverage-badge ]] [ coverage-page ]
22
3- Check if a [ node] [ ] is a [ ** script-supporting** ] [ spec ] [ element] [ ] .
3+ Check if a [ HAST node] [ hast ] is a [ ** script-supporting** ] [ spec ] [ element] [ ] .
44
55## Installation
66
@@ -10,57 +10,23 @@ Check if a [node][] is a [**script-supporting**][spec] [element][].
1010npm install hast-util-script-supporting
1111```
1212
13- ** hast-util-script-supporting** is also available as an AMD, CommonJS, and
14- globals module, [ uncompressed and compressed] [ releases ] .
15-
1613## Usage
1714
18- Dependencies:
19-
2015``` javascript
2116var scriptSupporting = require (' hast-util-script-supporting' );
22- ```
23-
24- Given a non-script-supporting value:
25-
26- ``` javascript
27- var result = scriptSupporting ({
28- ' type' : ' element' ,
29- ' tagName' : ' a' ,
30- ' properties' : {
31- ' href' : ' #alpha' ,
32- ' title' : ' Bravo'
33- },
34- ' children' : [{
35- ' type' : ' text' ,
36- ' value' : ' Charlie'
37- }]
38- });
39- ```
40-
41- Yields:
42-
43- ``` js
44- false
45- ```
46-
47- Given a script-supporting element:
4817
49- ``` javascript
50- result = scriptSupporting ({
51- ' type' : ' element' ,
52- ' tagName' : ' template' ,
53- ' children' : [{
54- ' type' : ' text' ,
55- ' value' : ' Delta'
56- }]
57- });
58- ```
59-
60- Yields:
61-
62- ``` js
63- true
18+ scriptSupporting ({
19+ type: ' element' ,
20+ tagName: ' a' ,
21+ properties: {href: ' #alpha' , title: ' Bravo' },
22+ children: [{type: ' text' , value: ' Charlie' }]
23+ }); // => false
24+
25+ scriptSupporting ({
26+ type: ' element' ,
27+ tagName: ' template' ,
28+ children: [{type: ' text' , value: ' Delta' }]
29+ }); // => true
6430```
6531
6632## API
6935
7036Check if the given value is a [ ** script-supporting** ] [ spec ] [ element] [ ] .
7137
72- ** Parameters** : ` node ` (` * ` ) — Value to check.
73-
74- ** Returns** : ` boolean ` , whether ` node ` passes the test.
75-
7638## License
7739
7840[ MIT] [ license ] © [ Titus Wormer] [ author ]
@@ -89,13 +51,11 @@ Check if the given value is a [**script-supporting**][spec] [element][].
8951
9052[ npm ] : https://docs.npmjs.com/cli/install
9153
92- [ releases ] : https://github.com/wooorm/hast-util-script-supporting/releases
93-
9454[ license ] : LICENSE
9555
9656[ author ] : http://wooorm.com
9757
98- [ node ] : https://github.com/wooorm/hast#node
58+ [ hast ] : https://github.com/wooorm/hast
9959
10060[ element ] : https://github.com/wooorm/hast#element
10161
0 commit comments