3
3
[ ![ Build] [ build-badge ]] [ build ]
4
4
[ ![ Coverage] [ coverage-badge ]] [ coverage ]
5
5
[ ![ Downloads] [ downloads-badge ]] [ downloads ]
6
+ [ ![ Size] [ size-badge ]] [ size ]
7
+ [ ![ Sponsors] [ sponsors-badge ]] [ collective ]
8
+ [ ![ Backers] [ backers-badge ]] [ collective ]
6
9
[ ![ Chat] [ chat-badge ]] [ chat ]
7
10
8
- Transform [ HAST ] [ ] to [ Parse5’s AST] [ ast ] .
11
+ [ ** hast ** ] [ hast ] utility to transform to [ Parse5’s AST] [ ast ] .
9
12
10
- Why not use an adapter? Because it’s more code weight to use adapters,
11
- and much more fragile.
13
+ > ** Q ** : Why not use a Parse5 adapter?
14
+ > ** A ** : Because it’s more code weight to use adapters, and much more fragile.
12
15
13
- ## Installation
16
+ ## Install
14
17
15
18
[ npm] [ ] :
16
19
17
- ``` bash
20
+ ``` sh
18
21
npm install hast-util-to-parse5
19
22
```
20
23
21
24
## Usage
22
25
23
- ``` javascript
26
+ ``` js
24
27
var toParse5 = require (' hast-util-to-parse5' )
25
28
26
29
var ast = toParse5 ({
@@ -47,25 +50,26 @@ Yields:
47
50
48
51
### ` toParse5(tree[, space]) `
49
52
50
- Transform a [ HAST Node] [ node ] to an ` ASTNode ` according to the default
51
- Parse5 adapter.
53
+ Transform a [ ** hast** ] [ hast ] [ * tree* ] [ tree ] to [ Parse5’s AST] [ ast ] .
52
54
53
55
###### ` space `
54
56
55
- Whether the root of the given tree is in the ` 'html' ` or ` 'svg' ` space (enum,
56
- ` 'svg' ` or ` 'html' ` , default: ` 'html' ` ).
57
+ Whether the root of the given [ * tree* ] [ tree ] is in the ` 'html' ` or ` 'svg' ` space
58
+ (enum, ` 'svg' ` or ` 'html' ` , default: ` 'html' ` ).
57
59
58
60
If an ` svg ` element is found in the HTML space, ` toParse5 ` automatically
59
61
switches to the SVG space when entering the element, and switches back when
60
- leaving .
62
+ exiting .
61
63
62
64
## Contribute
63
65
64
- See [ ` contributing.md ` in ` syntax-tree/hast ` ] [ contributing ] for ways to get
66
+ See [ ` contributing.md ` in ` syntax-tree/.github ` ] [ contributing ] for ways to get
65
67
started.
68
+ See [ ` support.md ` ] [ support ] for ways to get help.
66
69
67
- This organisation has a [ Code of Conduct] [ coc ] . By interacting with this
68
- repository, organisation, or community you agree to abide by its terms.
70
+ This project has a [ Code of Conduct] [ coc ] .
71
+ By interacting with this repository, organisation, or community you agree to
72
+ abide by its terms.
69
73
70
74
## License
71
75
@@ -85,22 +89,34 @@ repository, organisation, or community you agree to abide by its terms.
85
89
86
90
[ downloads ] : https://www.npmjs.com/package/hast-util-to-parse5
87
91
92
+ [ size-badge ] : https://img.shields.io/bundlephobia/minzip/hast-util-to-parse5.svg
93
+
94
+ [ size ] : https://bundlephobia.com/result?p=hast-util-to-parse5
95
+
96
+ [ sponsors-badge ] : https://opencollective.com/unified/sponsors/badge.svg
97
+
98
+ [ backers-badge ] : https://opencollective.com/unified/backers/badge.svg
99
+
100
+ [ collective ] : https://opencollective.com/unified
101
+
88
102
[ chat-badge ] : https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg
89
103
90
- [ chat ] : https://spectrum.chat/unified/rehype
104
+ [ chat ] : https://spectrum.chat/unified/syntax-tree
91
105
92
106
[ npm ] : https://docs.npmjs.com/cli/install
93
107
94
108
[ license ] : license
95
109
96
110
[ author ] : https://wooorm.com
97
111
98
- [ hast ] : https://github.com/syntax-tree/hast
112
+ [ contributing ] : https://github.com/syntax-tree/.github/blob/master/contributing.md
99
113
100
- [ ast ] : https://github.com/inikulin/parse5/wiki/Documentation
114
+ [ support ] : https://github.com/syntax-tree/.github/blob/master/support.md
101
115
102
- [ node ] : https://github.com/syntax-tree/hast#ast
116
+ [ coc ] : https://github.com/syntax-tree/.github/blob/master/code-of-conduct.md
103
117
104
- [ contributing ] : https://github.com/syntax-tree/hast/blob/master/contributing.md
118
+ [ ast ] : https://github.com/inikulin/parse5/wiki/Documentation
105
119
106
- [ coc ] : https://github.com/syntax-tree/hast/blob/master/code-of-conduct.md
120
+ [ tree ] : https://github.com/syntax-tree/unist#tree
121
+
122
+ [ hast ] : https://github.com/syntax-tree/hast
0 commit comments