1
- # mdast-util-to-string [ ![ Build ] [ build-badge ]] [ build ] [ ![ Coverage ] [ coverage-badge ]] [ coverage ] [ ![ Downloads ] [ downloads-badge ]] [ downloads ] [ ![ Chat ] [ chat-badge ]] [ chat ]
1
+ # mdast-util-to-string
2
2
3
- Get the plain text content of [ mdast] [ ] nodes.
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 ]
4
10
5
- ## Installation
11
+ [ ** mdast** ] [ mdast ] utility to get the plain text content of a node.
12
+
13
+ ## Install
6
14
7
15
[ npm] [ ] :
8
16
9
- ``` bash
17
+ ``` sh
10
18
npm install mdast-util-to-string
11
19
```
12
20
@@ -28,11 +36,11 @@ console.log(toString(tree)) // => 'Some emphasis, importance, and code.'
28
36
29
37
### ` toString(node) `
30
38
31
- Get the text content of a node.
39
+ Get the text content of a [ node] [ ] .
32
40
33
41
The algorithm checks ` value ` of ` node ` , then ` alt ` , and finally ` title ` .
34
- If no value is found, the algorithm checks the children of ` node ` and
35
- joins them (without spaces or newlines).
42
+ If no value is found, the algorithm checks the children of ` node ` and joins them
43
+ (without spaces or newlines).
36
44
37
45
> This is not a markdown to plain-text library.
38
46
> Use [ ` strip-markdown ` ] [ strip-markdown ] for that.
@@ -48,11 +56,13 @@ joins them (without spaces or newlines).
48
56
49
57
## Contribute
50
58
51
- See [ ` contributing.md ` in ` syntax-tree/mdast ` ] [ contributing ] for ways to get
59
+ See [ ` contributing.md ` in ` syntax-tree/.github ` ] [ contributing ] for ways to get
52
60
started.
61
+ See [ ` support.md ` ] [ support ] for ways to get help.
53
62
54
- This organisation has a [ Code of Conduct] [ coc ] . By interacting with this
55
- repository, organisation, or community you agree to abide by its terms.
63
+ This project has a [ Code of Conduct] [ coc ] .
64
+ By interacting with this repository, organisation, or community you agree to
65
+ abide by its terms.
56
66
57
67
## License
58
68
@@ -72,20 +82,34 @@ repository, organisation, or community you agree to abide by its terms.
72
82
73
83
[ downloads ] : https://www.npmjs.com/package/mdast-util-to-string
74
84
85
+ [ size-badge ] : https://img.shields.io/bundlephobia/minzip/mdast-util-to-string.svg
86
+
87
+ [ size ] : https://bundlephobia.com/result?p=mdast-util-to-string
88
+
89
+ [ sponsors-badge ] : https://opencollective.com/unified/sponsors/badge.svg
90
+
91
+ [ backers-badge ] : https://opencollective.com/unified/backers/badge.svg
92
+
93
+ [ collective ] : https://opencollective.com/unified
94
+
75
95
[ chat-badge ] : https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg
76
96
77
- [ chat ] : https://spectrum.chat/unified/remark
97
+ [ chat ] : https://spectrum.chat/unified/syntax-tree
98
+
99
+ [ npm ] : https://docs.npmjs.com/cli/install
78
100
79
101
[ license ] : license
80
102
81
103
[ author ] : https://wooorm.com
82
104
83
- [ npm ] : https://docs.npmjs. com/cli/install
105
+ [ contributing ] : https://github. com/syntax-tree/.github/blob/master/contributing.md
84
106
85
- [ mdast ] : https://github.com/syntax-tree/mdast
107
+ [ support ] : https://github.com/syntax-tree/.github/blob/master/support.md
108
+
109
+ [ coc ] : https://github.com/syntax-tree/.github/blob/master/code-of-conduct.md
86
110
87
- [ strip-markdown ] : https://github.com/wooorm/strip-markdown
111
+ [ mdast ] : https://github.com/syntax-tree/mdast
88
112
89
- [ contributing ] : https://github.com/syntax-tree/mdast/blob/master/contributing.md
113
+ [ node ] : https://github.com/syntax-tree/mdast#nodes
90
114
91
- [ coc ] : https://github.com/syntax-tree/mdast/blob/master/code-of-conduct.md
115
+ [ strip-markdown ] : https://github.com/remarkjs/strip-markdown
0 commit comments