@yozora/tokenizer-fenced-block 2.1.3 → 2.1.5
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 +496 -0
- package/README.md +42 -42
- package/package.json +6 -6
- package/src/index.ts +0 -8
- package/src/match.ts +0 -170
- package/src/tokenizer.ts +0 -44
- package/src/types.ts +0 -91
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,496 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
## [2.1.5](https://github.com/yozorajs/yozora/compare/v2.1.4...v2.1.5) (2023-05-13)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Performance Improvements
|
|
10
|
+
|
|
11
|
+
* 🔧 don't sourcemaps into tarball ([fc37aa8](https://github.com/yozorajs/yozora/commit/fc37aa8847ac4ad78ecb31f198e1cd6a85e91bcf))
|
|
12
|
+
* 📝 update CHANGELOGs ([c51b283](https://github.com/yozorajs/yozora/commit/c51b283874f8a562b6ed9fad46a0b7d578f6eb42))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## 2.1.4 (2023-04-02)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Performance Improvements
|
|
22
|
+
|
|
23
|
+
* 🔧 don't pack src/ folder into tarball ([c9fac38](https://github.com/yozorajs/yozora/commit/c9fac382e9a7a8d6454452b0c4d5b57dac16455f))
|
|
24
|
+
* 🔖 publish v2.1.4 ([aa464ed](https://github.com/yozorajs/yozora/commit/aa464ed1e3cd84892773a833910cfc53a556bf5f))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
## 2.1.3 (2023-03-23)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Performance Improvements
|
|
32
|
+
|
|
33
|
+
* 🔖 publish v2.1.3 ([9abaaff](https://github.com/yozorajs/yozora/commit/9abaaff74a12d0bae0f645813241ff947a0d828c))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
## 2.1.2 (2023-03-11)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
### Performance Improvements
|
|
41
|
+
|
|
42
|
+
* 🔖 publish v2.1.2 ([992baca](https://github.com/yozorajs/yozora/commit/992bacafd173e7788e99fed34ce8b45f6ed24cfe))
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## 2.1.1 (2023-03-10)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
### Performance Improvements
|
|
50
|
+
|
|
51
|
+
* 💥 prefer shorter types ([b93307f](https://github.com/yozorajs/yozora/commit/b93307f3c2372598dd8ca4fcbf04e80ce58d903d))
|
|
52
|
+
* 🔖 publish v2.1.1 ([257a36d](https://github.com/yozorajs/yozora/commit/257a36d8dc079d4ac226405c155b238e7099bcea))
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
## 2.0.6 (2023-03-05)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
### Performance Improvements
|
|
60
|
+
|
|
61
|
+
* 🔖 publish v2.0.6 ([a263c53](https://github.com/yozorajs/yozora/commit/a263c5338103824347bac74d437051e9fbb6d791))
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
## 2.0.5 (2023-01-09)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
### Performance Improvements
|
|
69
|
+
|
|
70
|
+
* 🔖 publish v2.0.5 ([7ba3bab](https://github.com/yozorajs/yozora/commit/7ba3bab49fe65cf2f57082c0503af73da9356cf0))
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
## 2.0.5-alpha.0 (2023-01-05)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
### Performance Improvements
|
|
78
|
+
|
|
79
|
+
* 🔧 fix test configuration ([f50b2d7](https://github.com/yozorajs/yozora/commit/f50b2d7600139e0ea54e042b025365d81f4518b5))
|
|
80
|
+
* 🔖 publish v2.0.5-alpha.0 ([8bf941f](https://github.com/yozorajs/yozora/commit/8bf941fe4ef82947165b0f3cc123cd493665e13b))
|
|
81
|
+
* 🔧 update package entries ([2c94f27](https://github.com/yozorajs/yozora/commit/2c94f27ffb645119a863f2ceee68a6b1b7285a67))
|
|
82
|
+
* ⬆️ upgrade devDependencies ([13059a9](https://github.com/yozorajs/yozora/commit/13059a924f3ae3b7fd69080ec9e82cde34a0f097))
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
## 2.0.4 (2022-11-02)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
### Performance Improvements
|
|
90
|
+
|
|
91
|
+
* 🔖 publish v2.0.4 ([c980b95](https://github.com/yozorajs/yozora/commit/c980b95254394dcacba0cbb4bea251350b09397c))
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
## 2.0.3 (2022-10-11)
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
### Performance Improvements
|
|
99
|
+
|
|
100
|
+
* 🔖 publish v2.0.3 ([8cc8f95](https://github.com/yozorajs/yozora/commit/8cc8f95cfebc8d752bc3272cdd24965f540c130b))
|
|
101
|
+
* 🔧 update build script ([d934cad](https://github.com/yozorajs/yozora/commit/d934cad21a4ab763621ca6a72379cd4294caa605))
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
## 2.0.2 (2022-09-24)
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
### Performance Improvements
|
|
109
|
+
|
|
110
|
+
* 📝 fix invalid links ([eb304c9](https://github.com/yozorajs/yozora/commit/eb304c931b2e682cf156bbceae0a20655777381e))
|
|
111
|
+
* 🔖 publish v2.0.2 ([6911295](https://github.com/yozorajs/yozora/commit/6911295e9eacfa29563fe93494704190e50625fd))
|
|
112
|
+
* 🔧 support node@16.x.x ([eda301f](https://github.com/yozorajs/yozora/commit/eda301fe1047e380de5be915ae730206a026f07b))
|
|
113
|
+
* 📝 update links ([4467fe6](https://github.com/yozorajs/yozora/commit/4467fe646e0a95fcc7206658189884f68872bc4e))
|
|
114
|
+
* 🔧 upgrade devDependencies & update tests ([6edb917](https://github.com/yozorajs/yozora/commit/6edb917fa9414ffe82d6411e19c6b362f1b06007))
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
## 2.0.2-alpha.0 (2022-05-22)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
### Performance Improvements
|
|
122
|
+
|
|
123
|
+
* 🔖 publish v2.0.2-alpha.0 ([430eaab](https://github.com/yozorajs/yozora/commit/430eaabd83f4a1ee29398ee1798aa4511976c38f))
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
## 2.0.1 (2022-05-21)
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
### Performance Improvements
|
|
131
|
+
|
|
132
|
+
* 🔖 publish v2.0.1 ([3aea330](https://github.com/yozorajs/yozora/commit/3aea33091e402bd6c7754d91d549e8d648475073))
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
# 2.0.0 (2022-01-15)
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
### Performance Improvements
|
|
140
|
+
|
|
141
|
+
* 💥 [breaking] rename 'NodePoint' and 'NodePosition' ([76692a2](https://github.com/yozorajs/yozora/commit/76692a211a82260bb81acffa5e9e9d41b569f673))
|
|
142
|
+
* 🔖 publish v2.0.0 ([65e99d1](https://github.com/yozorajs/yozora/commit/65e99d1709fdd1c918465dce6b1e91de96bdab5e))
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
# 2.0.0-alpha.3 (2022-01-12)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
### Features
|
|
150
|
+
|
|
151
|
+
* 💥 [breaking] remove 'IYastNode' prefix for AST types ([35c8fd2](https://github.com/yozorajs/yozora/commit/35c8fd2a6c27fb0bdb4020ccda5974ad05748c46))
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
### Performance Improvements
|
|
155
|
+
|
|
156
|
+
* 🔖 publish v2.0.0-alpha.3 ([9f274fc](https://github.com/yozorajs/yozora/commit/9f274fc7487a8c1dd213405d92508f9a7621f730))
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
# 2.0.0-alpha.2 (2022-01-09)
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
### Performance Improvements
|
|
164
|
+
|
|
165
|
+
* 🔖 publish v2.0.0-alpha.2 ([da59d85](https://github.com/yozorajs/yozora/commit/da59d85520455c59a117a35032ef1a035c10ea21))
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
# 2.0.0-alpha.1 (2022-01-08)
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
### Bug Fixes
|
|
173
|
+
|
|
174
|
+
* 🐛 fix incorrect export names ([b2d1fa7](https://github.com/yozorajs/yozora/commit/b2d1fa71d774bd78c87aa51435ba89593ebbeb24))
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
### Performance Improvements
|
|
178
|
+
|
|
179
|
+
* 🔖 publish v2.0.0-alpha.1 ([86202e1](https://github.com/yozorajs/yozora/commit/86202e1d2b03ccfc2ab030517d9d314f7aee7666))
|
|
180
|
+
* 📝 update READMEs ([320afeb](https://github.com/yozorajs/yozora/commit/320afebd6c500cbbce5fd65c1cd184bbd2224f25))
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
# 2.0.0-alpha.0 (2022-01-03)
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
### Bug Fixes
|
|
188
|
+
|
|
189
|
+
* 🐛 footnoteDefinition should be containing blocks, but fencedCode shouldn't be ([51c9133](https://github.com/yozorajs/yozora/commit/51c913361761b36ff54ef0ae49e549e3305bb789))
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
### Features
|
|
193
|
+
|
|
194
|
+
* 💥 [breaking] rename types with 'I' prefix ([d37d862](https://github.com/yozorajs/yozora/commit/d37d862212831dbe75ac92a6dbdadf2fa81cce8c))
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
### Performance Improvements
|
|
198
|
+
|
|
199
|
+
* 💥 refactor block tokenizers ([50ea4da](https://github.com/yozorajs/yozora/commit/50ea4dac5be8d7dd3d6eccf7e0ce1cfe05fe704a))
|
|
200
|
+
* 🔖 publish v2.0.0-alpha.0 ([0171501](https://github.com/yozorajs/yozora/commit/0171501339c49ffd02ed16a63447fa20a47a29a7))
|
|
201
|
+
* 🎨 rename parser hooks ([ef6cbc5](https://github.com/yozorajs/yozora/commit/ef6cbc51323e6ef9d4cd78f1c7194ae1f7819245))
|
|
202
|
+
* 🎨 set print width to 100 ([657a621](https://github.com/yozorajs/yozora/commit/657a6211cad52d5f1b183e7bcd7ea227b2aa7724))
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
# 1.3.0 (2021-10-09)
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
### Performance Improvements
|
|
210
|
+
|
|
211
|
+
* 🔖 publish v1.3.0 ([18c9b16](https://github.com/yozorajs/yozora/commit/18c9b167004ad97718b2f94f25139f80598cbf7a))
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
## 1.2.2 (2021-09-06)
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
### Performance Improvements
|
|
219
|
+
|
|
220
|
+
* 🔖 publish v1.2.2 ([fb4b804](https://github.com/yozorajs/yozora/commit/fb4b804548592c09259aabcf9cc4dd96176bd024))
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
## 1.2.1 (2021-09-04)
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
### Performance Improvements
|
|
228
|
+
|
|
229
|
+
* 🔖 publish v1.2.1 ([d98d07d](https://github.com/yozorajs/yozora/commit/d98d07d7c56dd9f6bb60149b2b0a4be2787e1046))
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
# 1.2.0 (2021-08-22)
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
### Performance Improvements
|
|
237
|
+
|
|
238
|
+
* 🔖 publish v1.2.0 ([86da40e](https://github.com/yozorajs/yozora/commit/86da40e50d2fe9acace68695288e15e012e6cd0d))
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
# 1.2.0-alpha.1 (2021-08-16)
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
### Performance Improvements
|
|
246
|
+
|
|
247
|
+
* 🔖 publish v1.2.0-alpha.1 ([ce3c173](https://github.com/yozorajs/yozora/commit/ce3c17330085f22404668a388f2bee6f57e6e958))
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
# 1.2.0-alpha.0 (2021-08-15)
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
### Performance Improvements
|
|
255
|
+
|
|
256
|
+
* 🔖 publish v1.2.0-alpha.0 ([bd8ef45](https://github.com/yozorajs/yozora/commit/bd8ef455a22963834a70339f42178138aab28df6))
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
# 1.1.0 (2021-08-12)
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
### Performance Improvements
|
|
264
|
+
|
|
265
|
+
* 🔖 publish v1.1.0 ([a8c7cff](https://github.com/yozorajs/yozora/commit/a8c7cffcbdc36930ab3c744450c8feb4395a9fac))
|
|
266
|
+
* 📝 update related references ([e2c8c7e](https://github.com/yozorajs/yozora/commit/e2c8c7e6ff8c5c1da27ca224d5c5d0eb4e5fbca7))
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
# 1.1.0-alpha.2 (2021-08-07)
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
### Performance Improvements
|
|
274
|
+
|
|
275
|
+
* 🔖 publish v1.1.0-alpha.2 ([d88b8ec](https://github.com/yozorajs/yozora/commit/d88b8eca03118b9f2a8b00ac4106ea82e779bc94))
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
# 1.1.0-alpha.1 (2021-08-01)
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
### Performance Improvements
|
|
283
|
+
|
|
284
|
+
* 🔖 publish v1.1.0-alpha.1 ([0d6aa91](https://github.com/yozorajs/yozora/commit/0d6aa91fb5a15b962b016496453dbfa7f1197126))
|
|
285
|
+
* 📝 update READMEs ([738d626](https://github.com/yozorajs/yozora/commit/738d626d76c535ea017812f674b43842ee073227))
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
# 1.1.0-alpha.0 (2021-07-31)
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
### Performance Improvements
|
|
293
|
+
|
|
294
|
+
* 🔖 publish v1.1.0-alpha.0 ([082653e](https://github.com/yozorajs/yozora/commit/082653e421889513588492774503d8ddcc24b8f9))
|
|
295
|
+
* 📝 update READMEs ([9905f04](https://github.com/yozorajs/yozora/commit/9905f0408b15d4478d021ef5c75497817f2db9a3))
|
|
296
|
+
* 📝 update READMEs ([03fe64c](https://github.com/yozorajs/yozora/commit/03fe64c6a9eab9bf810d4648261e7a808a13d1e1))
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
# 1.0.0 (2021-07-20)
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
### Performance Improvements
|
|
304
|
+
|
|
305
|
+
* 🔖 publish v1.0.0 ([ad754e3](https://github.com/yozorajs/yozora/commit/ad754e3a5945cd2ce19d9e6bfa59cb82caf0c7ac))
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
# 1.0.0-beta.0 (2021-07-08)
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
### Performance Improvements
|
|
313
|
+
|
|
314
|
+
* 🔖 publish v1.0.0-beta.0 ([bb66320](https://github.com/yozorajs/yozora/commit/bb6632098367cd8cf391eb1380d4542c15383bac))
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
# 1.0.0-1.0.0-beta.0.0 (2021-07-08)
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
### Performance Improvements
|
|
322
|
+
|
|
323
|
+
* 🔖 publish v1.0.0-1.0.0-beta.0.0 ([4051dd2](https://github.com/yozorajs/yozora/commit/4051dd2bcdea0d051141abaa85635e52d84c04f2))
|
|
324
|
+
* ⚡️ remove unnecessary codes ([cebe92a](https://github.com/yozorajs/yozora/commit/cebe92a3375d1d49054d332764f2490d4bb92c53))
|
|
325
|
+
* 📝 update READMEs ([9d9f940](https://github.com/yozorajs/yozora/commit/9d9f940a81188502db6045134054b18b747819bf))
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
# 1.0.0-alpha.29 (2021-07-08)
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
### Performance Improvements
|
|
333
|
+
|
|
334
|
+
* 🔖 publish v1.0.0-alpha.29 ([f2291db](https://github.com/yozorajs/yozora/commit/f2291db2812043dd6586eaabd14e427abb11663a))
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
# 1.0.0-alpha.28 (2021-06-30)
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
### Performance Improvements
|
|
342
|
+
|
|
343
|
+
* 🔖 publish v1.0.0-alpha.28 ([f18d90a](https://github.com/yozorajs/yozora/commit/f18d90a116db508bf49c9a3338a262cb85faf792))
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
# 1.0.0-alpha.27 (2021-06-28)
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
### Performance Improvements
|
|
351
|
+
|
|
352
|
+
* 🎨 update base abstract tokenizer ([cca9dd6](https://github.com/yozorajs/yozora/commit/cca9dd6fc3d4a22e1352378f59c7d2dccecfc5a2))
|
|
353
|
+
* 🔖 publish v1.0.0-alpha.27 ([8efea07](https://github.com/yozorajs/yozora/commit/8efea07b2314c241c91fc113abdc8852f216c9d7))
|
|
354
|
+
* ⬆️ upgrade dev dependencies ([d126ff4](https://github.com/yozorajs/yozora/commit/d126ff4c81ec09b366a0c60ba2a83e7f45fbe317))
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
# 1.0.0-alpha.26 (2021-06-25)
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
### Performance Improvements
|
|
362
|
+
|
|
363
|
+
* 🔖 publish v1.0.0-alpha.26 ([cbde29c](https://github.com/yozorajs/yozora/commit/cbde29c6188c9183f0b39ccfac0ad310803b09fe))
|
|
364
|
+
* 📝 update READMEs ([11e4f61](https://github.com/yozorajs/yozora/commit/11e4f6107c3862bf8c81dae882e93cab3f56f40f))
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
# 1.0.0-alpha.25 (2021-06-17)
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
### Performance Improvements
|
|
372
|
+
|
|
373
|
+
* 🔖 publish v1.0.0-alpha.25 ([5e17f71](https://github.com/yozorajs/yozora/commit/5e17f7155391c21eb1c99e5024e48d5e208e80db))
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
# 1.0.0-alpha.24 (2021-06-10)
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
### Performance Improvements
|
|
381
|
+
|
|
382
|
+
* 🔖 publish v1.0.0-alpha.24 ([6169f8e](https://github.com/yozorajs/yozora/commit/6169f8ecda42e04203e4533f820e82ea3e93b7dd))
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
# 1.0.0-alpha.23 (2021-06-08)
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
### Performance Improvements
|
|
390
|
+
|
|
391
|
+
* Move repository from github.com/guanghechen to github.com/yozorajs ([c1fd32c](https://github.com/yozorajs/yozora/commit/c1fd32ce818b44aa0d993ec8f74ef514bdf2d834))
|
|
392
|
+
* 🔖 publish v1.0.0-alpha.23 ([131a216](https://github.com/yozorajs/yozora/commit/131a2162b64eb23f98e93286974f4a3e4a91b77a))
|
|
393
|
+
* 📝 update READMEs ([6420941](https://github.com/yozorajs/yozora/commit/64209414cacdaf0e04329e2c86e6ff41f885f55f))
|
|
394
|
+
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
# 1.0.0-alpha.22 (2021-05-20)
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
### Performance Improvements
|
|
401
|
+
|
|
402
|
+
* 🎨 lint codes ([0d2d798](https://github.com/yozorajs/yozora/commit/0d2d7988d1d46f873e2a9f5d37de9c5daa39a109))
|
|
403
|
+
* 🔖 publish v1.0.0-alpha.22 ([a07a41d](https://github.com/yozorajs/yozora/commit/a07a41de8dda2ff579b0e5b469db75d6c629c38b))
|
|
404
|
+
* 🔧 rename the main branch to 'main' instead of 'master' ([c915653](https://github.com/yozorajs/yozora/commit/c9156537fba68ce073e139eb487afb973b7d90ba))
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
# 1.0.0-alpha.21 (2021-05-12)
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
### Performance Improvements
|
|
412
|
+
|
|
413
|
+
* 🔖 publish v1.0.0-alpha.21 ([e6655a2](https://github.com/yozorajs/yozora/commit/e6655a252c0b799d0990f06bc7cfdadc6824b63c))
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
# 1.0.0-alpha.20 (2021-04-20)
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
### Performance Improvements
|
|
421
|
+
|
|
422
|
+
* 🔖 publish v1.0.0-alpha.20 ([3f3831f](https://github.com/yozorajs/yozora/commit/3f3831fb6fdb72319e7d24a1ba4b51b44bdb4c8d))
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+
# 1.0.0-alpha.19 (2021-04-19)
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
### Performance Improvements
|
|
430
|
+
|
|
431
|
+
* 🔖 publish v1.0.0-alpha.19 ([50b55f9](https://github.com/yozorajs/yozora/commit/50b55f9e5fd1d00c03d271a488d2a648ccd0a1d1))
|
|
432
|
+
* 📝 update READMEs ([907af97](https://github.com/yozorajs/yozora/commit/907af97f8c0bca5b045ccae188c6b759e88ec38c))
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
# 1.0.0-alpha.18 (2021-04-18)
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
### Performance Improvements
|
|
440
|
+
|
|
441
|
+
* :bug: [fenced-block] fix: blank lines without enough indent also should be preserved in fenced-block, fenced-code and admonition ([3a4c7de](https://github.com/yozorajs/yozora/commit/3a4c7dea01eaddc5699207f369cb06d39f80a098))
|
|
442
|
+
* 🔖 publish v1.0.0-alpha.18 ([219b28b](https://github.com/yozorajs/yozora/commit/219b28b38975d6d41f6c285a512a5c0dccceb6fa))
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
# 1.0.0-alpha.17 (2021-04-15)
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
### Performance Improvements
|
|
450
|
+
|
|
451
|
+
* 🎨 optimize duplicate codes ([347ae9b](https://github.com/yozorajs/yozora/commit/347ae9b897aeeee8a6c73280660e2bd1878c113e))
|
|
452
|
+
* 🔖 publish v1.0.0-alpha.17 ([0e7facd](https://github.com/yozorajs/yozora/commit/0e7facdde8692e538e5777d70b873cf6282f7de8))
|
|
453
|
+
* 📝 update docs ([acffd75](https://github.com/yozorajs/yozora/commit/acffd757123705c4d0f6a3948f62f3c460cefde3))
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
# 1.0.0-alpha.16 (2021-04-12)
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
### Performance Improvements
|
|
461
|
+
|
|
462
|
+
* 🔖 publish v1.0.0-alpha.16 ([9da34dd](https://github.com/yozorajs/yozora/commit/9da34dd46333b72f908c77d15f11326f3724060c))
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
# 1.0.0-alpha.15 (2021-04-11)
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
### Performance Improvements
|
|
470
|
+
|
|
471
|
+
* 🔖 publish v1.0.0-alpha.15 ([988d25f](https://github.com/yozorajs/yozora/commit/988d25f7958825ccbaaa99051ad7b823c625d4cf))
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
# 1.0.0-alpha.14 (2021-04-11)
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
### Performance Improvements
|
|
479
|
+
|
|
480
|
+
* 🔖 publish v1.0.0-alpha.14 ([3fcfffa](https://github.com/yozorajs/yozora/commit/3fcfffa0da0413449acf0d91d85400d0b31fa9a2))
|
|
481
|
+
* 🎨 rename isContainerBlock to isContainingBlock & use enum TokenizerPriority instead of magic numbers to present tokenizer proirity ([940c50b](https://github.com/yozorajs/yozora/commit/940c50bb58b76a888a512539f3a4db6e8396d45b))
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
# 1.0.0-alpha.13 (2021-04-10)
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
### Features
|
|
489
|
+
|
|
490
|
+
* ✨ add new tokenizer @yozora/tokenizer-fenced-block ([b9600e9](https://github.com/yozorajs/yozora/commit/b9600e9b0796b47abe162b0d761e79269ce80118))
|
|
491
|
+
|
|
492
|
+
|
|
493
|
+
### Performance Improvements
|
|
494
|
+
|
|
495
|
+
* :art: [core-parser] improve: enhance ParseBlockPhaseApi to support parsing inlines in the parse-block phase ([75e67bd](https://github.com/yozorajs/yozora/commit/75e67bd6e7a7e2ad054bc34c8b30960cccd1bec8))
|
|
496
|
+
* 🔖 publish v1.0.0-alpha.13 ([949455c](https://github.com/yozorajs/yozora/commit/949455c25f4fb60a88c3484829a610da7c998969))
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<header>
|
|
4
4
|
<h1 align="center">
|
|
5
|
-
<a href="https://github.com/yozorajs/yozora/tree/
|
|
5
|
+
<a href="https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/fenced-block#readme">@yozora/tokenizer-fenced-block</a>
|
|
6
6
|
</h1>
|
|
7
7
|
<div align="center">
|
|
8
8
|
<a href="https://www.npmjs.com/package/@yozora/tokenizer-fenced-block">
|
|
@@ -66,53 +66,53 @@
|
|
|
66
66
|
|
|
67
67
|
[live-examples]: https://yozora.guanghechen.com/docs/package/tokenizer-fenced-block#live-examples
|
|
68
68
|
[docpage]: https://yozora.guanghechen.com/docs/package/tokenizer-fenced-block
|
|
69
|
-
[homepage]: https://github.com/yozorajs/yozora/tree/
|
|
69
|
+
[homepage]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/fenced-block#readme
|
|
70
70
|
[gfm-spec]: https://github.github.com/gfm
|
|
71
71
|
[mdast-homepage]: https://github.com/syntax-tree/mdast
|
|
72
72
|
|
|
73
|
-
[@yozora/ast]: https://github.com/yozorajs/yozora/tree/
|
|
74
|
-
[@yozora/ast-util]: https://github.com/yozorajs/yozora/tree/
|
|
75
|
-
[@yozora/character]: https://github.com/yozorajs/yozora/tree/
|
|
73
|
+
[@yozora/ast]: https://github.com/yozorajs/yozora/tree/v2.1.5/packages/ast#readme
|
|
74
|
+
[@yozora/ast-util]: https://github.com/yozorajs/yozora/tree/v2.1.5/packages/ast-util#readme
|
|
75
|
+
[@yozora/character]: https://github.com/yozorajs/yozora/tree/v2.1.5/packages/character#readme
|
|
76
76
|
[@yozora/eslint-config]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/eslint-config#readme
|
|
77
|
-
[@yozora/core-parser]: https://github.com/yozorajs/yozora/tree/
|
|
78
|
-
[@yozora/core-tokenizer]: https://github.com/yozorajs/yozora/tree/
|
|
79
|
-
[@yozora/invariant]: https://github.com/yozorajs/yozora/tree/
|
|
77
|
+
[@yozora/core-parser]: https://github.com/yozorajs/yozora/tree/v2.1.5/packages/core-parser#readme
|
|
78
|
+
[@yozora/core-tokenizer]: https://github.com/yozorajs/yozora/tree/v2.1.5/packages/core-tokenizer#readme
|
|
79
|
+
[@yozora/invariant]: https://github.com/yozorajs/yozora/tree/v2.1.5/packages/invariant#readme
|
|
80
80
|
[@yozora/jest-for-tokenizer]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/jest-for-tokenizer#readme
|
|
81
|
-
[@yozora/parser]: https://github.com/yozorajs/yozora/tree/
|
|
82
|
-
[@yozora/parser-gfm]: https://github.com/yozorajs/yozora/tree/
|
|
83
|
-
[@yozora/parser-gfm-ex]: https://github.com/yozorajs/yozora/tree/
|
|
81
|
+
[@yozora/parser]: https://github.com/yozorajs/yozora/tree/v2.1.5/packages/parser#readme
|
|
82
|
+
[@yozora/parser-gfm]: https://github.com/yozorajs/yozora/tree/v2.1.5/packages/parser-gfm#readme
|
|
83
|
+
[@yozora/parser-gfm-ex]: https://github.com/yozorajs/yozora/tree/v2.1.5/packages/parser-gfm-ex#readme
|
|
84
84
|
[@yozora/template-tokenizer]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/template-tokenizer#readme
|
|
85
|
-
[@yozora/tokenizer-admonition]: https://github.com/yozorajs/yozora/tree/
|
|
86
|
-
[@yozora/tokenizer-autolink]: https://github.com/yozorajs/yozora/tree/
|
|
87
|
-
[@yozora/tokenizer-autolink-extension]: https://github.com/yozorajs/yozora/tree/
|
|
88
|
-
[@yozora/tokenizer-blockquote]: https://github.com/yozorajs/yozora/tree/
|
|
89
|
-
[@yozora/tokenizer-break]: https://github.com/yozorajs/yozora/tree/
|
|
90
|
-
[@yozora/tokenizer-definition]: https://github.com/yozorajs/yozora/tree/
|
|
91
|
-
[@yozora/tokenizer-delete]: https://github.com/yozorajs/yozora/tree/
|
|
92
|
-
[@yozora/tokenizer-ecma-import]: https://github.com/yozorajs/yozora/tree/
|
|
93
|
-
[@yozora/tokenizer-emphasis]: https://github.com/yozorajs/yozora/tree/
|
|
94
|
-
[@yozora/tokenizer-fenced-block]: https://github.com/yozorajs/yozora/tree/
|
|
95
|
-
[@yozora/tokenizer-fenced-code]: https://github.com/yozorajs/yozora/tree/
|
|
96
|
-
[@yozora/tokenizer-footnote]: https://github.com/yozorajs/yozora/tree/
|
|
97
|
-
[@yozora/tokenizer-footnote-definition]: https://github.com/yozorajs/yozora/tree/
|
|
98
|
-
[@yozora/tokenizer-footnote-reference]: https://github.com/yozorajs/yozora/tree/
|
|
99
|
-
[@yozora/tokenizer-heading]: https://github.com/yozorajs/yozora/tree/
|
|
100
|
-
[@yozora/tokenizer-html-block]: https://github.com/yozorajs/yozora/tree/
|
|
101
|
-
[@yozora/tokenizer-html-inline]: https://github.com/yozorajs/yozora/tree/
|
|
102
|
-
[@yozora/tokenizer-image]: https://github.com/yozorajs/yozora/tree/
|
|
103
|
-
[@yozora/tokenizer-image-reference]: https://github.com/yozorajs/yozora/tree/
|
|
104
|
-
[@yozora/tokenizer-indented-code]: https://github.com/yozorajs/yozora/tree/
|
|
105
|
-
[@yozora/tokenizer-inline-code]: https://github.com/yozorajs/yozora/tree/
|
|
106
|
-
[@yozora/tokenizer-inline-math]: https://github.com/yozorajs/yozora/tree/
|
|
107
|
-
[@yozora/tokenizer-link]: https://github.com/yozorajs/yozora/tree/
|
|
108
|
-
[@yozora/tokenizer-link-reference]: https://github.com/yozorajs/yozora/tree/
|
|
109
|
-
[@yozora/tokenizer-list]: https://github.com/yozorajs/yozora/tree/
|
|
110
|
-
[@yozora/tokenizer-math]: https://github.com/yozorajs/yozora/tree/
|
|
111
|
-
[@yozora/tokenizer-paragraph]: https://github.com/yozorajs/yozora/tree/
|
|
112
|
-
[@yozora/tokenizer-setext-heading]: https://github.com/yozorajs/yozora/tree/
|
|
113
|
-
[@yozora/tokenizer-table]: https://github.com/yozorajs/yozora/tree/
|
|
114
|
-
[@yozora/tokenizer-text]: https://github.com/yozorajs/yozora/tree/
|
|
115
|
-
[@yozora/tokenizer-thematic-break]: https://github.com/yozorajs/yozora/tree/
|
|
85
|
+
[@yozora/tokenizer-admonition]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/admonition#readme
|
|
86
|
+
[@yozora/tokenizer-autolink]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/autolink#readme
|
|
87
|
+
[@yozora/tokenizer-autolink-extension]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/autolink-extension#readme
|
|
88
|
+
[@yozora/tokenizer-blockquote]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/blockquote#readme
|
|
89
|
+
[@yozora/tokenizer-break]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/break#readme
|
|
90
|
+
[@yozora/tokenizer-definition]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/definition#readme
|
|
91
|
+
[@yozora/tokenizer-delete]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/delete#readme
|
|
92
|
+
[@yozora/tokenizer-ecma-import]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/ecma-import#readme
|
|
93
|
+
[@yozora/tokenizer-emphasis]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/emphasis#readme
|
|
94
|
+
[@yozora/tokenizer-fenced-block]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/fenced-block#readme
|
|
95
|
+
[@yozora/tokenizer-fenced-code]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/fenced-code#readme
|
|
96
|
+
[@yozora/tokenizer-footnote]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/footnote#readme
|
|
97
|
+
[@yozora/tokenizer-footnote-definition]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/footnote-definition#readme
|
|
98
|
+
[@yozora/tokenizer-footnote-reference]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/footnote-reference#readme
|
|
99
|
+
[@yozora/tokenizer-heading]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/heading#readme
|
|
100
|
+
[@yozora/tokenizer-html-block]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/html-block#readme
|
|
101
|
+
[@yozora/tokenizer-html-inline]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/html-inline#readme
|
|
102
|
+
[@yozora/tokenizer-image]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/image#readme
|
|
103
|
+
[@yozora/tokenizer-image-reference]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/image-reference#readme
|
|
104
|
+
[@yozora/tokenizer-indented-code]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/indented-code#readme
|
|
105
|
+
[@yozora/tokenizer-inline-code]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/inline-code#readme
|
|
106
|
+
[@yozora/tokenizer-inline-math]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/inline-math#readme
|
|
107
|
+
[@yozora/tokenizer-link]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/link#readme
|
|
108
|
+
[@yozora/tokenizer-link-reference]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/link-reference#readme
|
|
109
|
+
[@yozora/tokenizer-list]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/list#readme
|
|
110
|
+
[@yozora/tokenizer-math]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/math#readme
|
|
111
|
+
[@yozora/tokenizer-paragraph]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/paragraph#readme
|
|
112
|
+
[@yozora/tokenizer-setext-heading]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/setext-heading#readme
|
|
113
|
+
[@yozora/tokenizer-table]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/table#readme
|
|
114
|
+
[@yozora/tokenizer-text]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/text#readme
|
|
115
|
+
[@yozora/tokenizer-thematic-break]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/thematic-break#readme
|
|
116
116
|
|
|
117
117
|
[@yozora/react-admonition]: https://github.com/yozorajs/yozora-react/tree/main/packages/admonition#readme
|
|
118
118
|
[@yozora/react-blockquote]: https://github.com/yozorajs/yozora-react/tree/main/packages/blockquote#readme
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yozora/tokenizer-fenced-block",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.5",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "guanghechen",
|
|
6
6
|
"url": "https://github.com/guanghechen/"
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"files": [
|
|
29
29
|
"lib/",
|
|
30
|
-
"
|
|
30
|
+
"!lib/**/*.map",
|
|
31
31
|
"package.json",
|
|
32
32
|
"CHANGELOG.md",
|
|
33
33
|
"LICENSE",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"prepublishOnly": "cross-env ROLLUP_SHOULD_SOURCEMAP=false yarn build"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@yozora/ast": "^2.1.
|
|
42
|
-
"@yozora/character": "^2.1.
|
|
43
|
-
"@yozora/core-tokenizer": "^2.1.
|
|
41
|
+
"@yozora/ast": "^2.1.5",
|
|
42
|
+
"@yozora/character": "^2.1.5",
|
|
43
|
+
"@yozora/core-tokenizer": "^2.1.5"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "4f753bcf0fd921938464802462dc48c53bbd014d"
|
|
46
46
|
}
|
package/src/index.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { match as fencedBlockMatch } from './match'
|
|
2
|
-
export { FencedBlockTokenizer, FencedBlockTokenizer as default } from './tokenizer'
|
|
3
|
-
export { FencedBlockType } from './types'
|
|
4
|
-
export type {
|
|
5
|
-
IFencedBlockHookContext,
|
|
6
|
-
IToken as IFencedBlockToken,
|
|
7
|
-
ITokenizerProps as IFencedBlockTokenizerProps,
|
|
8
|
-
} from './types'
|
package/src/match.ts
DELETED
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import type { NodeType } from '@yozora/ast'
|
|
2
|
-
import type { INodePoint } from '@yozora/character'
|
|
3
|
-
import { calcTrimBoundaryOfCodePoints, isSpaceCharacter } from '@yozora/character'
|
|
4
|
-
import type {
|
|
5
|
-
IBlockToken,
|
|
6
|
-
IMatchBlockHook,
|
|
7
|
-
IMatchBlockPhaseApi,
|
|
8
|
-
IPhrasingContentLine,
|
|
9
|
-
IResultOfEatAndInterruptPreviousSibling,
|
|
10
|
-
IResultOfEatContinuationText,
|
|
11
|
-
IResultOfEatOpener,
|
|
12
|
-
} from '@yozora/core-tokenizer'
|
|
13
|
-
import { calcEndPoint, calcStartPoint, eatOptionalCharacters } from '@yozora/core-tokenizer'
|
|
14
|
-
import type { IFencedBlockHookContext, IToken } from './types'
|
|
15
|
-
|
|
16
|
-
export function match<
|
|
17
|
-
T extends NodeType = NodeType,
|
|
18
|
-
IThis extends IFencedBlockHookContext<T> = IFencedBlockHookContext<T>,
|
|
19
|
-
>(this: IThis, _api: IMatchBlockPhaseApi): IMatchBlockHook<T, IToken<T>> {
|
|
20
|
-
const { nodeType, markers, markersRequired, checkInfoString } = this
|
|
21
|
-
return {
|
|
22
|
-
isContainingBlock: false,
|
|
23
|
-
eatOpener,
|
|
24
|
-
eatAndInterruptPreviousSibling,
|
|
25
|
-
eatContinuationText,
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function eatOpener(line: Readonly<IPhrasingContentLine>): IResultOfEatOpener<T, IToken<T>> {
|
|
29
|
-
/**
|
|
30
|
-
* Four spaces indentation produces an indented code block
|
|
31
|
-
* @see https://github.github.com/gfm/#example-104
|
|
32
|
-
*/
|
|
33
|
-
if (line.countOfPrecedeSpaces >= 4) return null
|
|
34
|
-
|
|
35
|
-
const { endIndex, firstNonWhitespaceIndex } = line
|
|
36
|
-
if (firstNonWhitespaceIndex + markersRequired - 1 >= endIndex) return null
|
|
37
|
-
|
|
38
|
-
const { nodePoints, startIndex } = line
|
|
39
|
-
const marker: number = nodePoints[firstNonWhitespaceIndex].codePoint
|
|
40
|
-
if (markers.indexOf(marker) < 0) return null
|
|
41
|
-
|
|
42
|
-
const i = eatOptionalCharacters(nodePoints, firstNonWhitespaceIndex + 1, endIndex, marker)
|
|
43
|
-
const countOfMark = i - firstNonWhitespaceIndex
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* The number of marker is not enough.
|
|
47
|
-
* @see https://github.github.com/gfm/#example-91
|
|
48
|
-
*/
|
|
49
|
-
if (countOfMark < markersRequired) return null
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Eating Information string
|
|
53
|
-
* The line with the opening block fence may optionally contain some text
|
|
54
|
-
* following the block fence; this is trimmed of leading and trailing
|
|
55
|
-
* whitespace and called the info string. If the info string comes after
|
|
56
|
-
* a backtick fence, it may not contain any backtick characters. (The
|
|
57
|
-
* reason for this restriction is that otherwise some inline code would
|
|
58
|
-
* be incorrectly interpreted as the beginning of a fenced code block.)
|
|
59
|
-
* @see https://github.github.com/gfm/#info-string
|
|
60
|
-
*/
|
|
61
|
-
const [iLft, iRht] = calcTrimBoundaryOfCodePoints(nodePoints, i, endIndex)
|
|
62
|
-
const infoString: INodePoint[] = nodePoints.slice(iLft, iRht)
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Check if info string is valid, such as info strings for backtick code
|
|
66
|
-
* blocks cannot contain backticks.
|
|
67
|
-
* @see https://github.github.com/gfm/#example-115
|
|
68
|
-
* @see https://github.github.com/gfm/#example-116
|
|
69
|
-
*/
|
|
70
|
-
if (checkInfoString != null && !checkInfoString(infoString, marker, countOfMark)) {
|
|
71
|
-
return null
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
const nextIndex = endIndex
|
|
75
|
-
const token: IToken<T> = {
|
|
76
|
-
nodeType: nodeType as T,
|
|
77
|
-
position: {
|
|
78
|
-
start: calcStartPoint(nodePoints, startIndex),
|
|
79
|
-
end: calcEndPoint(nodePoints, nextIndex - 1),
|
|
80
|
-
},
|
|
81
|
-
indent: firstNonWhitespaceIndex - startIndex,
|
|
82
|
-
marker: marker!,
|
|
83
|
-
markerCount: countOfMark,
|
|
84
|
-
lines: [],
|
|
85
|
-
infoString,
|
|
86
|
-
}
|
|
87
|
-
return { token, nextIndex }
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function eatAndInterruptPreviousSibling(
|
|
91
|
-
line: Readonly<IPhrasingContentLine>,
|
|
92
|
-
prevSiblingToken: Readonly<IBlockToken>,
|
|
93
|
-
): IResultOfEatAndInterruptPreviousSibling<T, IToken<T>> {
|
|
94
|
-
const result = eatOpener(line)
|
|
95
|
-
if (result == null) return null
|
|
96
|
-
return {
|
|
97
|
-
token: result.token,
|
|
98
|
-
nextIndex: result.nextIndex,
|
|
99
|
-
remainingSibling: prevSiblingToken,
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
function eatContinuationText(
|
|
104
|
-
line: Readonly<IPhrasingContentLine>,
|
|
105
|
-
token: IToken<T>,
|
|
106
|
-
): IResultOfEatContinuationText {
|
|
107
|
-
const { nodePoints, startIndex, endIndex, firstNonWhitespaceIndex, countOfPrecedeSpaces } = line
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Check closing block fence
|
|
111
|
-
*
|
|
112
|
-
* The closing block fence may be indented up to three spaces, and may be
|
|
113
|
-
* followed only by spaces, which are ignored. If the end of the containing
|
|
114
|
-
* block (or document) is reached and no closing block fence has been found,
|
|
115
|
-
* the code block contains all of the lines after the opening block fence
|
|
116
|
-
* until the end of the containing block (or document). (An alternative spec
|
|
117
|
-
* would require backtracking in the event that a closing block fence is not
|
|
118
|
-
* found. But this makes parsing much less efficient, and there seems to be
|
|
119
|
-
* no real down side to the behavior described here.)
|
|
120
|
-
* @see https://github.github.com/gfm/#code-fence
|
|
121
|
-
*
|
|
122
|
-
* Closing fence indented with at most 3 spaces
|
|
123
|
-
* @see https://github.github.com/gfm/#example-107
|
|
124
|
-
*/
|
|
125
|
-
if (countOfPrecedeSpaces < 4 && firstNonWhitespaceIndex < endIndex) {
|
|
126
|
-
let i = eatOptionalCharacters(nodePoints, firstNonWhitespaceIndex, endIndex, token.marker)
|
|
127
|
-
const markerCount = i - firstNonWhitespaceIndex
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* The closing block fence must be at least as long as the opening fence
|
|
131
|
-
* @see https://github.github.com/gfm/#example-94
|
|
132
|
-
*/
|
|
133
|
-
if (markerCount >= token.markerCount) {
|
|
134
|
-
// The closing block fence may be followed only by spaces.
|
|
135
|
-
for (; i < endIndex; ++i) {
|
|
136
|
-
const c = nodePoints[i].codePoint
|
|
137
|
-
if (!isSpaceCharacter(c)) break
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
if (i + 1 >= endIndex) {
|
|
141
|
-
return { status: 'closing', nextIndex: endIndex }
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* Eating code content
|
|
148
|
-
*
|
|
149
|
-
* The content of the code block consists of all subsequent lines, until a
|
|
150
|
-
* closing block fence of the same type as the code block began with
|
|
151
|
-
* (backticks or tildes), and with at least as many backticks or tildes as
|
|
152
|
-
* the opening block fence. If the leading block fence is indented N spaces,
|
|
153
|
-
* then up to N spaces of indentation are removed from each line of the
|
|
154
|
-
* content (if present).
|
|
155
|
-
*
|
|
156
|
-
* If a content line is not indented, it is preserved unchanged. If it is
|
|
157
|
-
* indented less than N spaces, all of the indentation is removed, but the
|
|
158
|
-
* line feed should be preserve.
|
|
159
|
-
*/
|
|
160
|
-
const firstIndex = Math.min(startIndex + token.indent, firstNonWhitespaceIndex, endIndex - 1)
|
|
161
|
-
token.lines.push({
|
|
162
|
-
nodePoints,
|
|
163
|
-
startIndex: firstIndex,
|
|
164
|
-
endIndex,
|
|
165
|
-
firstNonWhitespaceIndex,
|
|
166
|
-
countOfPrecedeSpaces,
|
|
167
|
-
})
|
|
168
|
-
return { status: 'opening', nextIndex: endIndex }
|
|
169
|
-
}
|
|
170
|
-
}
|
package/src/tokenizer.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { Node, NodeType } from '@yozora/ast'
|
|
2
|
-
import type { ICodePoint } from '@yozora/character'
|
|
3
|
-
import type { IBlockTokenizer, IMatchBlockHookCreator } from '@yozora/core-tokenizer'
|
|
4
|
-
import { BaseBlockTokenizer, TokenizerPriority } from '@yozora/core-tokenizer'
|
|
5
|
-
import { match } from './match'
|
|
6
|
-
import type { IFencedBlockHookContext, IToken, ITokenizerProps } from './types'
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Lexical Matcher for FencedBlock.
|
|
10
|
-
*
|
|
11
|
-
* A block fence is a sequence of fence-marker characters (different marker
|
|
12
|
-
* cannot be mixed.) A fenced block begins with a block fence, indented no more
|
|
13
|
-
* than three spaces.
|
|
14
|
-
*
|
|
15
|
-
* @see https://github.com/syntax-tree/mdast#code
|
|
16
|
-
* @see https://github.github.com/gfm/#code-fence
|
|
17
|
-
*/
|
|
18
|
-
export abstract class FencedBlockTokenizer<
|
|
19
|
-
T extends NodeType = NodeType,
|
|
20
|
-
INode extends Node<T> = Node<T>,
|
|
21
|
-
IThis extends IFencedBlockHookContext<T> = IFencedBlockHookContext<T>,
|
|
22
|
-
>
|
|
23
|
-
extends BaseBlockTokenizer<T, IToken<T>, INode, any>
|
|
24
|
-
implements IBlockTokenizer<T, IToken<T>, INode, IThis>
|
|
25
|
-
{
|
|
26
|
-
protected readonly nodeType: T
|
|
27
|
-
protected readonly markers: ICodePoint[] = []
|
|
28
|
-
protected readonly markersRequired: number
|
|
29
|
-
protected readonly checkInfoString: ITokenizerProps<T>['checkInfoString']
|
|
30
|
-
|
|
31
|
-
/* istanbul ignore next */
|
|
32
|
-
constructor(props: ITokenizerProps<T>) {
|
|
33
|
-
super({
|
|
34
|
-
name: props.name,
|
|
35
|
-
priority: props.priority ?? TokenizerPriority.FENCED_BLOCK,
|
|
36
|
-
})
|
|
37
|
-
this.nodeType = props.nodeType
|
|
38
|
-
this.markers = props.markers
|
|
39
|
-
this.markersRequired = props.markersRequired
|
|
40
|
-
this.checkInfoString = props.checkInfoString
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
public override readonly match: IMatchBlockHookCreator<T, IToken<T>, IThis> = match
|
|
44
|
-
}
|
package/src/types.ts
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import type { NodeType } from '@yozora/ast'
|
|
2
|
-
import type { ICodePoint, INodePoint } from '@yozora/character'
|
|
3
|
-
import type {
|
|
4
|
-
IBaseBlockTokenizerProps,
|
|
5
|
-
IPartialBlockToken,
|
|
6
|
-
IPhrasingContentLine,
|
|
7
|
-
ITokenizer,
|
|
8
|
-
} from '@yozora/core-tokenizer'
|
|
9
|
-
|
|
10
|
-
export const FencedBlockType = 'fencedBlock'
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
12
|
-
export type FencedBlockType = typeof FencedBlockType
|
|
13
|
-
|
|
14
|
-
export interface IToken<T extends NodeType> extends IPartialBlockToken<T> {
|
|
15
|
-
/**
|
|
16
|
-
* Line indent of a fenced block.
|
|
17
|
-
*/
|
|
18
|
-
indent: number
|
|
19
|
-
/**
|
|
20
|
-
* Fence marker.
|
|
21
|
-
*/
|
|
22
|
-
marker: number
|
|
23
|
-
/**
|
|
24
|
-
* The number of fence marker.
|
|
25
|
-
*/
|
|
26
|
-
markerCount: number
|
|
27
|
-
/**
|
|
28
|
-
* Lines to construct the contents of a paragraph.
|
|
29
|
-
*/
|
|
30
|
-
lines: IPhrasingContentLine[]
|
|
31
|
-
/**
|
|
32
|
-
* Meta info string
|
|
33
|
-
*/
|
|
34
|
-
infoString: INodePoint[]
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export interface IFencedBlockHookContext<T extends NodeType> extends ITokenizer {
|
|
38
|
-
/**
|
|
39
|
-
* Type of special FencedBlock token and FencedBlock node.
|
|
40
|
-
*/
|
|
41
|
-
nodeType: T
|
|
42
|
-
/**
|
|
43
|
-
* Available fence markers.
|
|
44
|
-
*/
|
|
45
|
-
markers: ICodePoint[]
|
|
46
|
-
/**
|
|
47
|
-
* The minimum amount required
|
|
48
|
-
*/
|
|
49
|
-
markersRequired: number
|
|
50
|
-
/**
|
|
51
|
-
* Check if the info string is valid.
|
|
52
|
-
* @param infoString
|
|
53
|
-
* @param marker
|
|
54
|
-
* @param countOfMarker
|
|
55
|
-
*/
|
|
56
|
-
checkInfoString?(
|
|
57
|
-
infoString: Readonly<INodePoint[]>,
|
|
58
|
-
marker: ICodePoint,
|
|
59
|
-
countOfMarker: number,
|
|
60
|
-
): boolean
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export interface ITokenizerProps<T extends NodeType> extends Partial<IBaseBlockTokenizerProps> {
|
|
64
|
-
/**
|
|
65
|
-
* ITokenizer name.
|
|
66
|
-
*/
|
|
67
|
-
name: string
|
|
68
|
-
/**
|
|
69
|
-
* Type of special FencedBlock token and FencedBlock node.
|
|
70
|
-
*/
|
|
71
|
-
nodeType: T
|
|
72
|
-
/**
|
|
73
|
-
* Available fence markers.
|
|
74
|
-
*/
|
|
75
|
-
markers: ICodePoint[]
|
|
76
|
-
/**
|
|
77
|
-
* The minimum amount required
|
|
78
|
-
*/
|
|
79
|
-
markersRequired: number
|
|
80
|
-
/**
|
|
81
|
-
* Check if the info string is valid.
|
|
82
|
-
* @param infoString
|
|
83
|
-
* @param marker
|
|
84
|
-
* @param countOfMarker
|
|
85
|
-
*/
|
|
86
|
-
checkInfoString?(
|
|
87
|
-
infoString: Readonly<INodePoint[]>,
|
|
88
|
-
marker: ICodePoint,
|
|
89
|
-
countOfMarker: number,
|
|
90
|
-
): boolean
|
|
91
|
-
}
|