samemark 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/KNOWN_GAPS.md +84 -0
- package/LICENSE +21 -0
- package/README.md +676 -2
- package/core.d.ts +10 -0
- package/core.js +10 -0
- package/dist/LICENSES.txt +217 -0
- package/dist/core.cjs +7178 -0
- package/dist/stream.cjs +6967 -0
- package/examples/react-chat/StreamMarkdown.jsx +67 -0
- package/index.d.ts +10 -0
- package/index.js +14 -0
- package/lib/api.js +155 -0
- package/lib/probe.js +109 -0
- package/lib/rows.js +47 -0
- package/lib/signature.js +77 -0
- package/lib/types.d.ts +46 -0
- package/lib/verify.js +38 -0
- package/package.json +140 -4
- package/src/block.js +1807 -0
- package/src/inline.js +1597 -0
- package/src/stream.js +178 -0
- package/stream.d.ts +26 -0
- package/stream.js +7 -0
package/core.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type {Plugin} from 'unified'
|
|
2
|
+
import type {Root} from 'mdast'
|
|
3
|
+
import type {Options} from './lib/types.js'
|
|
4
|
+
|
|
5
|
+
export type {Options, ParseOptions, FallbackContext, Stats} from './lib/types.js'
|
|
6
|
+
export {parse, check, stats} from './lib/types.js'
|
|
7
|
+
|
|
8
|
+
/** Unified parser plugin: stock GFM takes the fast path; anything else needs a fallback (see `Options.fallback`). */
|
|
9
|
+
export const remarkParseFast: Plugin<[(Options | null | undefined)?], string, Root>
|
|
10
|
+
export default remarkParseFast
|
package/core.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// samemark/core: the fast parser with no fallback import. Unsupported extensions throw (unless a fallback
|
|
2
|
+
// function is passed, or remark-parse was set up before this plugin, in which case it is used).
|
|
3
|
+
import {createApi} from './lib/api.js'
|
|
4
|
+
|
|
5
|
+
const api = createApi(null, null)
|
|
6
|
+
export const parse = api.parse
|
|
7
|
+
export const remarkParseFast = api.remarkParseFast
|
|
8
|
+
export const check = api.check
|
|
9
|
+
export const stats = api.stats
|
|
10
|
+
export default remarkParseFast
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
dist/core.cjs and dist/stream.cjs inline these MIT-licensed packages. Their licences:
|
|
2
|
+
|
|
3
|
+
---- ccount@2.0.1 ----
|
|
4
|
+
(The MIT License)
|
|
5
|
+
|
|
6
|
+
Copyright (c) 2015 Titus Wormer <tituswormer@gmail.com>
|
|
7
|
+
|
|
8
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
9
|
+
a copy of this software and associated documentation files (the
|
|
10
|
+
'Software'), to deal in the Software without restriction, including
|
|
11
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
12
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
13
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
14
|
+
the following conditions:
|
|
15
|
+
|
|
16
|
+
The above copyright notice and this permission notice shall be
|
|
17
|
+
included in all copies or substantial portions of the Software.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
20
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
21
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
22
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
23
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
24
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
25
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
26
|
+
|
|
27
|
+
---- decode-named-character-reference@1.3.0 ----
|
|
28
|
+
(The MIT License)
|
|
29
|
+
|
|
30
|
+
Copyright (c) Titus Wormer <tituswormer@gmail.com>
|
|
31
|
+
|
|
32
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
33
|
+
a copy of this software and associated documentation files (the
|
|
34
|
+
'Software'), to deal in the Software without restriction, including
|
|
35
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
36
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
37
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
38
|
+
the following conditions:
|
|
39
|
+
|
|
40
|
+
The above copyright notice and this permission notice shall be
|
|
41
|
+
included in all copies or substantial portions of the Software.
|
|
42
|
+
|
|
43
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
44
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
45
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
46
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
47
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
48
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
49
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
50
|
+
|
|
51
|
+
---- micromark-util-decode-numeric-character-reference@2.0.2 ----
|
|
52
|
+
(The MIT License)
|
|
53
|
+
|
|
54
|
+
Copyright (c) Titus Wormer <tituswormer@gmail.com>
|
|
55
|
+
|
|
56
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
57
|
+
a copy of this software and associated documentation files (the
|
|
58
|
+
'Software'), to deal in the Software without restriction, including
|
|
59
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
60
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
61
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
62
|
+
the following conditions:
|
|
63
|
+
|
|
64
|
+
The above copyright notice and this permission notice shall be
|
|
65
|
+
included in all copies or substantial portions of the Software.
|
|
66
|
+
|
|
67
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
68
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
69
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
70
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
71
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
72
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
73
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
74
|
+
|
|
75
|
+
---- micromark-util-decode-string@2.0.1 ----
|
|
76
|
+
(The MIT License)
|
|
77
|
+
|
|
78
|
+
Copyright (c) Titus Wormer <tituswormer@gmail.com>
|
|
79
|
+
|
|
80
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
81
|
+
a copy of this software and associated documentation files (the
|
|
82
|
+
'Software'), to deal in the Software without restriction, including
|
|
83
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
84
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
85
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
86
|
+
the following conditions:
|
|
87
|
+
|
|
88
|
+
The above copyright notice and this permission notice shall be
|
|
89
|
+
included in all copies or substantial portions of the Software.
|
|
90
|
+
|
|
91
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
92
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
93
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
94
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
95
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
96
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
97
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
98
|
+
|
|
99
|
+
---- micromark-util-html-tag-name@2.0.1 ----
|
|
100
|
+
(The MIT License)
|
|
101
|
+
|
|
102
|
+
Copyright (c) Titus Wormer <tituswormer@gmail.com>
|
|
103
|
+
|
|
104
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
105
|
+
a copy of this software and associated documentation files (the
|
|
106
|
+
'Software'), to deal in the Software without restriction, including
|
|
107
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
108
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
109
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
110
|
+
the following conditions:
|
|
111
|
+
|
|
112
|
+
The above copyright notice and this permission notice shall be
|
|
113
|
+
included in all copies or substantial portions of the Software.
|
|
114
|
+
|
|
115
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
116
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
117
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
118
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
119
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
120
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
121
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
122
|
+
|
|
123
|
+
---- micromark-util-normalize-identifier@2.0.1 ----
|
|
124
|
+
(The MIT License)
|
|
125
|
+
|
|
126
|
+
Copyright (c) Titus Wormer <tituswormer@gmail.com>
|
|
127
|
+
|
|
128
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
129
|
+
a copy of this software and associated documentation files (the
|
|
130
|
+
'Software'), to deal in the Software without restriction, including
|
|
131
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
132
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
133
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
134
|
+
the following conditions:
|
|
135
|
+
|
|
136
|
+
The above copyright notice and this permission notice shall be
|
|
137
|
+
included in all copies or substantial portions of the Software.
|
|
138
|
+
|
|
139
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
140
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
141
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
142
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
143
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
144
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
145
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
146
|
+
|
|
147
|
+
---- micromark-util-character@2.1.1 ----
|
|
148
|
+
(The MIT License)
|
|
149
|
+
|
|
150
|
+
Copyright (c) Titus Wormer <tituswormer@gmail.com>
|
|
151
|
+
|
|
152
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
153
|
+
a copy of this software and associated documentation files (the
|
|
154
|
+
'Software'), to deal in the Software without restriction, including
|
|
155
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
156
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
157
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
158
|
+
the following conditions:
|
|
159
|
+
|
|
160
|
+
The above copyright notice and this permission notice shall be
|
|
161
|
+
included in all copies or substantial portions of the Software.
|
|
162
|
+
|
|
163
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
164
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
165
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
166
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
167
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
168
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
169
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
170
|
+
|
|
171
|
+
---- micromark-util-symbol@2.0.1 ----
|
|
172
|
+
(The MIT License)
|
|
173
|
+
|
|
174
|
+
Copyright (c) Titus Wormer <tituswormer@gmail.com>
|
|
175
|
+
|
|
176
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
177
|
+
a copy of this software and associated documentation files (the
|
|
178
|
+
'Software'), to deal in the Software without restriction, including
|
|
179
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
180
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
181
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
182
|
+
the following conditions:
|
|
183
|
+
|
|
184
|
+
The above copyright notice and this permission notice shall be
|
|
185
|
+
included in all copies or substantial portions of the Software.
|
|
186
|
+
|
|
187
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
188
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
189
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
190
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
191
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
192
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
193
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
194
|
+
|
|
195
|
+
---- character-entities@2.0.2 ----
|
|
196
|
+
(The MIT License)
|
|
197
|
+
|
|
198
|
+
Copyright (c) 2015 Titus Wormer <tituswormer@gmail.com>
|
|
199
|
+
|
|
200
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
201
|
+
a copy of this software and associated documentation files (the
|
|
202
|
+
'Software'), to deal in the Software without restriction, including
|
|
203
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
204
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
205
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
206
|
+
the following conditions:
|
|
207
|
+
|
|
208
|
+
The above copyright notice and this permission notice shall be
|
|
209
|
+
included in all copies or substantial portions of the Software.
|
|
210
|
+
|
|
211
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
212
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
213
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
214
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
215
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
216
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
217
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|