@yozora/tokenizer-footnote-definition 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 ADDED
@@ -0,0 +1,462 @@
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
+
115
+
116
+
117
+ ## 2.0.2-alpha.0 (2022-05-22)
118
+
119
+
120
+ ### Performance Improvements
121
+
122
+ * 🔖 publish v2.0.2-alpha.0 ([430eaab](https://github.com/yozorajs/yozora/commit/430eaabd83f4a1ee29398ee1798aa4511976c38f))
123
+
124
+
125
+
126
+ ## 2.0.1 (2022-05-21)
127
+
128
+
129
+ ### Performance Improvements
130
+
131
+ * ✅ refactor test utils & rename createTester to createTokenizerTester ([7f2ce75](https://github.com/yozorajs/yozora/commit/7f2ce7571a336370d419aa01073bf8054783cfd9))
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 'I' prefix for AST node types ([cad4b0b](https://github.com/yozorajs/yozora/commit/cad4b0b5b8061ea495f6455ef1554bb3c8f223a0))
152
+ * 💥 [breaking] remove 'IYastNode' prefix for AST types ([35c8fd2](https://github.com/yozorajs/yozora/commit/35c8fd2a6c27fb0bdb4020ccda5974ad05748c46))
153
+
154
+
155
+ ### Performance Improvements
156
+
157
+ * 🔖 publish v2.0.0-alpha.3 ([9f274fc](https://github.com/yozorajs/yozora/commit/9f274fc7487a8c1dd213405d92508f9a7621f730))
158
+
159
+
160
+
161
+ # 2.0.0-alpha.2 (2022-01-09)
162
+
163
+
164
+ ### Performance Improvements
165
+
166
+ * 🎨 refactor removePosition ([87a974f](https://github.com/yozorajs/yozora/commit/87a974fd744ae937d5778d3cdba4b345141bcaf6))
167
+ * 🔖 publish v2.0.0-alpha.2 ([da59d85](https://github.com/yozorajs/yozora/commit/da59d85520455c59a117a35032ef1a035c10ea21))
168
+ * 🎨 simplify codes ([0712473](https://github.com/yozorajs/yozora/commit/0712473e824f532844e73f9e2023b591fb6bd6a5))
169
+
170
+
171
+
172
+ # 2.0.0-alpha.1 (2022-01-08)
173
+
174
+
175
+ ### Features
176
+
177
+ * :breaking: refactor parse-block hooks ([117104d](https://github.com/yozorajs/yozora/commit/117104de9668a0d160e9e008ee6305811e83aec6))
178
+
179
+
180
+ ### Performance Improvements
181
+
182
+ * 🔖 publish v2.0.0-alpha.1 ([86202e1](https://github.com/yozorajs/yozora/commit/86202e1d2b03ccfc2ab030517d9d314f7aee7666))
183
+ * 🎨 rename IHookContext to IThis ([04d5470](https://github.com/yozorajs/yozora/commit/04d5470c9949c4acfe6239289d34a8b5c6191e71))
184
+ * 📝 update READMEs ([320afeb](https://github.com/yozorajs/yozora/commit/320afebd6c500cbbce5fd65c1cd184bbd2224f25))
185
+
186
+
187
+
188
+ # 2.0.0-alpha.0 (2022-01-03)
189
+
190
+
191
+ ### Bug Fixes
192
+
193
+ * 🐛 footnoteDefinition should be containing blocks, but fencedCode shouldn't be ([51c9133](https://github.com/yozorajs/yozora/commit/51c913361761b36ff54ef0ae49e549e3305bb789))
194
+
195
+
196
+ ### Features
197
+
198
+ * 💥 [breaking] rename types with 'I' prefix ([d37d862](https://github.com/yozorajs/yozora/commit/d37d862212831dbe75ac92a6dbdadf2fa81cce8c))
199
+
200
+
201
+ ### Performance Improvements
202
+
203
+ * 💥 refactor block tokenizers ([50ea4da](https://github.com/yozorajs/yozora/commit/50ea4dac5be8d7dd3d6eccf7e0ce1cfe05fe704a))
204
+ * 🔖 publish v2.0.0-alpha.0 ([0171501](https://github.com/yozorajs/yozora/commit/0171501339c49ffd02ed16a63447fa20a47a29a7))
205
+ * 🎨 rename parser hooks ([ef6cbc5](https://github.com/yozorajs/yozora/commit/ef6cbc51323e6ef9d4cd78f1c7194ae1f7819245))
206
+ * 🎨 set print width to 100 ([657a621](https://github.com/yozorajs/yozora/commit/657a6211cad52d5f1b183e7bcd7ea227b2aa7724))
207
+
208
+
209
+
210
+ # 1.3.0 (2021-10-09)
211
+
212
+
213
+ ### Performance Improvements
214
+
215
+ * 🔖 publish v1.3.0 ([18c9b16](https://github.com/yozorajs/yozora/commit/18c9b167004ad97718b2f94f25139f80598cbf7a))
216
+ * 🎨 set the default `children` to empty array instead of undefined ([8fe26ca](https://github.com/yozorajs/yozora/commit/8fe26ca085ec7d48148895fddbec019a84c24a8a))
217
+
218
+
219
+
220
+ ## 1.2.2 (2021-09-06)
221
+
222
+
223
+ ### Performance Improvements
224
+
225
+ * 🔖 publish v1.2.2 ([fb4b804](https://github.com/yozorajs/yozora/commit/fb4b804548592c09259aabcf9cc4dd96176bd024))
226
+
227
+
228
+
229
+ ## 1.2.1 (2021-09-04)
230
+
231
+
232
+ ### Performance Improvements
233
+
234
+ * 🔖 publish v1.2.1 ([d98d07d](https://github.com/yozorajs/yozora/commit/d98d07d7c56dd9f6bb60149b2b0a4be2787e1046))
235
+
236
+
237
+
238
+ # 1.2.0 (2021-08-22)
239
+
240
+
241
+ ### Performance Improvements
242
+
243
+ * 🔖 publish v1.2.0 ([86da40e](https://github.com/yozorajs/yozora/commit/86da40e50d2fe9acace68695288e15e012e6cd0d))
244
+
245
+
246
+
247
+ # 1.2.0-alpha.1 (2021-08-16)
248
+
249
+
250
+ ### Performance Improvements
251
+
252
+ * 🔖 publish v1.2.0-alpha.1 ([ce3c173](https://github.com/yozorajs/yozora/commit/ce3c17330085f22404668a388f2bee6f57e6e958))
253
+
254
+
255
+
256
+ # 1.2.0-alpha.0 (2021-08-15)
257
+
258
+
259
+ ### Performance Improvements
260
+
261
+ * 🔖 publish v1.2.0-alpha.0 ([bd8ef45](https://github.com/yozorajs/yozora/commit/bd8ef455a22963834a70339f42178138aab28df6))
262
+
263
+
264
+
265
+ # 1.1.0 (2021-08-12)
266
+
267
+
268
+ ### Performance Improvements
269
+
270
+ * 🔖 publish v1.1.0 ([a8c7cff](https://github.com/yozorajs/yozora/commit/a8c7cffcbdc36930ab3c744450c8feb4395a9fac))
271
+ * 📝 update related references ([e2c8c7e](https://github.com/yozorajs/yozora/commit/e2c8c7e6ff8c5c1da27ca224d5c5d0eb4e5fbca7))
272
+
273
+
274
+
275
+ # 1.1.0-alpha.2 (2021-08-07)
276
+
277
+
278
+ ### Performance Improvements
279
+
280
+ * 🔖 publish v1.1.0-alpha.2 ([d88b8ec](https://github.com/yozorajs/yozora/commit/d88b8eca03118b9f2a8b00ac4106ea82e779bc94))
281
+ * 👽️ update due to the previous changes & add tests ([f6b076b](https://github.com/yozorajs/yozora/commit/f6b076ba2e62bc97a42100b7ed241154f9fb0b37))
282
+
283
+
284
+
285
+ # 1.1.0-alpha.1 (2021-08-01)
286
+
287
+
288
+ ### Performance Improvements
289
+
290
+ * 🔖 publish v1.1.0-alpha.1 ([0d6aa91](https://github.com/yozorajs/yozora/commit/0d6aa91fb5a15b962b016496453dbfa7f1197126))
291
+ * 📝 update READMEs ([738d626](https://github.com/yozorajs/yozora/commit/738d626d76c535ea017812f674b43842ee073227))
292
+
293
+
294
+
295
+ # 1.1.0-alpha.0 (2021-07-31)
296
+
297
+
298
+ ### Performance Improvements
299
+
300
+ * 🔖 publish v1.1.0-alpha.0 ([082653e](https://github.com/yozorajs/yozora/commit/082653e421889513588492774503d8ddcc24b8f9))
301
+ * 📝 update READMEs ([9905f04](https://github.com/yozorajs/yozora/commit/9905f0408b15d4478d021ef5c75497817f2db9a3))
302
+ * 📝 update READMEs ([03fe64c](https://github.com/yozorajs/yozora/commit/03fe64c6a9eab9bf810d4648261e7a808a13d1e1))
303
+
304
+
305
+
306
+ # 1.0.0 (2021-07-20)
307
+
308
+
309
+ ### Performance Improvements
310
+
311
+ * 🔖 publish v1.0.0 ([ad754e3](https://github.com/yozorajs/yozora/commit/ad754e3a5945cd2ce19d9e6bfa59cb82caf0c7ac))
312
+
313
+
314
+
315
+ # 1.0.0-beta.0 (2021-07-08)
316
+
317
+
318
+ ### Performance Improvements
319
+
320
+ * 🔖 publish v1.0.0-beta.0 ([bb66320](https://github.com/yozorajs/yozora/commit/bb6632098367cd8cf391eb1380d4542c15383bac))
321
+
322
+
323
+
324
+ # 1.0.0-1.0.0-beta.0.0 (2021-07-08)
325
+
326
+
327
+ ### Performance Improvements
328
+
329
+ * 🔖 publish v1.0.0-1.0.0-beta.0.0 ([4051dd2](https://github.com/yozorajs/yozora/commit/4051dd2bcdea0d051141abaa85635e52d84c04f2))
330
+ * 📝 update READMEs ([9d9f940](https://github.com/yozorajs/yozora/commit/9d9f940a81188502db6045134054b18b747819bf))
331
+
332
+
333
+
334
+ # 1.0.0-alpha.29 (2021-07-08)
335
+
336
+
337
+ ### Performance Improvements
338
+
339
+ * expose new utility func 'createTester' and 'createTesters' ([a4e9613](https://github.com/yozorajs/yozora/commit/a4e9613063e3e5840cf066e6e7343dbd5ffd4884))
340
+ * 📝 fix invalid link references ([f7b97b3](https://github.com/yozorajs/yozora/commit/f7b97b3dc74f065aa8f00ecd846ee4fa7f704453))
341
+ * 🔖 publish v1.0.0-alpha.29 ([f2291db](https://github.com/yozorajs/yozora/commit/f2291db2812043dd6586eaabd14e427abb11663a))
342
+ * 🎨 use path alias in tests ([29cca94](https://github.com/yozorajs/yozora/commit/29cca943d4fbc6d26af4507d3fa75ac08dcf388a))
343
+
344
+
345
+
346
+ # 1.0.0-alpha.28 (2021-06-30)
347
+
348
+
349
+ ### Performance Improvements
350
+
351
+ * 🔖 publish v1.0.0-alpha.28 ([f18d90a](https://github.com/yozorajs/yozora/commit/f18d90a116db508bf49c9a3338a262cb85faf792))
352
+
353
+
354
+
355
+ # 1.0.0-alpha.27 (2021-06-28)
356
+
357
+
358
+ ### Bug Fixes
359
+
360
+ * 🐛 FootnoteDefinitionTokenizer has priority over DefinitionTokenizer ([a19084a](https://github.com/yozorajs/yozora/commit/a19084ad864ee87f229ee0e9f6fde6aa3a48267e))
361
+
362
+
363
+ ### Performance Improvements
364
+
365
+ * 🎨 update base abstract tokenizer ([cca9dd6](https://github.com/yozorajs/yozora/commit/cca9dd6fc3d4a22e1352378f59c7d2dccecfc5a2))
366
+ * 🔖 publish v1.0.0-alpha.27 ([8efea07](https://github.com/yozorajs/yozora/commit/8efea07b2314c241c91fc113abdc8852f216c9d7))
367
+ * 📝 update READMEs ([8a7e60b](https://github.com/yozorajs/yozora/commit/8a7e60b0802f755e17e8e27a82166610802bf4fc))
368
+ * ⬆️ upgrade dev dependencies ([d126ff4](https://github.com/yozorajs/yozora/commit/d126ff4c81ec09b366a0c60ba2a83e7f45fbe317))
369
+
370
+
371
+
372
+ # 1.0.0-alpha.26 (2021-06-25)
373
+
374
+
375
+ ### Performance Improvements
376
+
377
+ * 🔖 publish v1.0.0-alpha.26 ([cbde29c](https://github.com/yozorajs/yozora/commit/cbde29c6188c9183f0b39ccfac0ad310803b09fe))
378
+ * 📝 update READMEs ([11e4f61](https://github.com/yozorajs/yozora/commit/11e4f6107c3862bf8c81dae882e93cab3f56f40f))
379
+
380
+
381
+
382
+ # 1.0.0-alpha.25 (2021-06-17)
383
+
384
+
385
+ ### Performance Improvements
386
+
387
+ * 🔖 publish v1.0.0-alpha.25 ([5e17f71](https://github.com/yozorajs/yozora/commit/5e17f7155391c21eb1c99e5024e48d5e208e80db))
388
+
389
+
390
+
391
+ # 1.0.0-alpha.24 (2021-06-10)
392
+
393
+
394
+ ### Performance Improvements
395
+
396
+ * 🔖 publish v1.0.0-alpha.24 ([6169f8e](https://github.com/yozorajs/yozora/commit/6169f8ecda42e04203e4533f820e82ea3e93b7dd))
397
+
398
+
399
+
400
+ # 1.0.0-alpha.23 (2021-06-08)
401
+
402
+
403
+ ### Performance Improvements
404
+
405
+ * Move repository from github.com/guanghechen to github.com/yozorajs ([c1fd32c](https://github.com/yozorajs/yozora/commit/c1fd32ce818b44aa0d993ec8f74ef514bdf2d834))
406
+ * 🔖 publish v1.0.0-alpha.23 ([131a216](https://github.com/yozorajs/yozora/commit/131a2162b64eb23f98e93286974f4a3e4a91b77a))
407
+ * 📝 update READMEs ([6420941](https://github.com/yozorajs/yozora/commit/64209414cacdaf0e04329e2c86e6ff41f885f55f))
408
+
409
+
410
+
411
+ # 1.0.0-alpha.22 (2021-05-20)
412
+
413
+
414
+ ### Performance Improvements
415
+
416
+ * 🎨 lint codes ([0d2d798](https://github.com/yozorajs/yozora/commit/0d2d7988d1d46f873e2a9f5d37de9c5daa39a109))
417
+ * 🔖 publish v1.0.0-alpha.22 ([a07a41d](https://github.com/yozorajs/yozora/commit/a07a41de8dda2ff579b0e5b469db75d6c629c38b))
418
+ * 🔧 rename the main branch to 'main' instead of 'master' ([c915653](https://github.com/yozorajs/yozora/commit/c9156537fba68ce073e139eb487afb973b7d90ba))
419
+
420
+
421
+
422
+ # 1.0.0-alpha.21 (2021-05-12)
423
+
424
+
425
+ ### Performance Improvements
426
+
427
+ * 🔖 publish v1.0.0-alpha.21 ([e6655a2](https://github.com/yozorajs/yozora/commit/e6655a252c0b799d0990f06bc7cfdadc6824b63c))
428
+
429
+
430
+
431
+ # 1.0.0-alpha.20 (2021-04-20)
432
+
433
+
434
+ ### Performance Improvements
435
+
436
+ * 🔖 publish v1.0.0-alpha.20 ([3f3831f](https://github.com/yozorajs/yozora/commit/3f3831fb6fdb72319e7d24a1ba4b51b44bdb4c8d))
437
+
438
+
439
+
440
+ # 1.0.0-alpha.19 (2021-04-19)
441
+
442
+
443
+ ### Performance Improvements
444
+
445
+ * 🔖 publish v1.0.0-alpha.19 ([50b55f9](https://github.com/yozorajs/yozora/commit/50b55f9e5fd1d00c03d271a488d2a648ccd0a1d1))
446
+ * 📝 update READMEs ([907af97](https://github.com/yozorajs/yozora/commit/907af97f8c0bca5b045ccae188c6b759e88ec38c))
447
+
448
+
449
+
450
+ # 1.0.0-alpha.18 (2021-04-18)
451
+
452
+
453
+ ### Features
454
+
455
+ * ✨ implemented new tokenizer @yozora/tokenizer-definition-footnote & and built it into @yozora/parser ([eb796f8](https://github.com/yozorajs/yozora/commit/eb796f840cddc7bcbfa8f11f5aef01bedc7fbb41))
456
+ * ✨ implemented new tokenizer @yozora/tokenizer-definition-footnote & and built it into @yozora/parser & update tests ([dad817f](https://github.com/yozorajs/yozora/commit/dad817f24d43731167d972a31742a7898354f920))
457
+
458
+
459
+ ### Performance Improvements
460
+
461
+ * 🎨 move resolveLabelToIdentifier from @yozora/tokenizer-definition to @yozora/core-tokenizer ([a957a31](https://github.com/yozorajs/yozora/commit/a957a31cc6faed786f453968e9a364577b5617ad))
462
+ * 🔖 publish v1.0.0-alpha.18 ([219b28b](https://github.com/yozorajs/yozora/commit/219b28b38975d6d41f6c285a512a5c0dccceb6fa))
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/release-2.x.x/tokenizers/footnote-definition#readme">@yozora/tokenizer-footnote-definition</a>
5
+ <a href="https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/footnote-definition#readme">@yozora/tokenizer-footnote-definition</a>
6
6
  </h1>
7
7
  <div align="center">
8
8
  <a href="https://www.npmjs.com/package/@yozora/tokenizer-footnote-definition">
@@ -237,53 +237,53 @@ Name | Type | Required | Default
237
237
 
238
238
  [live-examples]: https://yozora.guanghechen.com/docs/package/tokenizer-footnote-definition#live-examples
239
239
  [docpage]: https://yozora.guanghechen.com/docs/package/tokenizer-footnote-definition
240
- [homepage]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/footnote-definition#readme
240
+ [homepage]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/footnote-definition#readme
241
241
  [gfm-spec]: https://github.github.com/gfm
242
242
  [mdast-homepage]: https://github.com/syntax-tree/mdast
243
243
 
244
- [@yozora/ast]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/ast#readme
245
- [@yozora/ast-util]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/ast-util#readme
246
- [@yozora/character]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/character#readme
244
+ [@yozora/ast]: https://github.com/yozorajs/yozora/tree/v2.1.5/packages/ast#readme
245
+ [@yozora/ast-util]: https://github.com/yozorajs/yozora/tree/v2.1.5/packages/ast-util#readme
246
+ [@yozora/character]: https://github.com/yozorajs/yozora/tree/v2.1.5/packages/character#readme
247
247
  [@yozora/eslint-config]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/eslint-config#readme
248
- [@yozora/core-parser]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/core-parser#readme
249
- [@yozora/core-tokenizer]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/core-tokenizer#readme
250
- [@yozora/invariant]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/invariant#readme
248
+ [@yozora/core-parser]: https://github.com/yozorajs/yozora/tree/v2.1.5/packages/core-parser#readme
249
+ [@yozora/core-tokenizer]: https://github.com/yozorajs/yozora/tree/v2.1.5/packages/core-tokenizer#readme
250
+ [@yozora/invariant]: https://github.com/yozorajs/yozora/tree/v2.1.5/packages/invariant#readme
251
251
  [@yozora/jest-for-tokenizer]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/jest-for-tokenizer#readme
252
- [@yozora/parser]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/parser#readme
253
- [@yozora/parser-gfm]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/parser-gfm#readme
254
- [@yozora/parser-gfm-ex]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/parser-gfm-ex#readme
252
+ [@yozora/parser]: https://github.com/yozorajs/yozora/tree/v2.1.5/packages/parser#readme
253
+ [@yozora/parser-gfm]: https://github.com/yozorajs/yozora/tree/v2.1.5/packages/parser-gfm#readme
254
+ [@yozora/parser-gfm-ex]: https://github.com/yozorajs/yozora/tree/v2.1.5/packages/parser-gfm-ex#readme
255
255
  [@yozora/template-tokenizer]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/template-tokenizer#readme
256
- [@yozora/tokenizer-admonition]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/admonition#readme
257
- [@yozora/tokenizer-autolink]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/autolink#readme
258
- [@yozora/tokenizer-autolink-extension]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/autolink-extension#readme
259
- [@yozora/tokenizer-blockquote]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/blockquote#readme
260
- [@yozora/tokenizer-break]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/break#readme
261
- [@yozora/tokenizer-definition]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/definition#readme
262
- [@yozora/tokenizer-delete]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/delete#readme
263
- [@yozora/tokenizer-ecma-import]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/ecma-import#readme
264
- [@yozora/tokenizer-emphasis]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/emphasis#readme
265
- [@yozora/tokenizer-fenced-block]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/fenced-block#readme
266
- [@yozora/tokenizer-fenced-code]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/fenced-code#readme
267
- [@yozora/tokenizer-footnote]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/footnote#readme
268
- [@yozora/tokenizer-footnote-definition]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/footnote-definition#readme
269
- [@yozora/tokenizer-footnote-reference]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/footnote-reference#readme
270
- [@yozora/tokenizer-heading]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/heading#readme
271
- [@yozora/tokenizer-html-block]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/html-block#readme
272
- [@yozora/tokenizer-html-inline]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/html-inline#readme
273
- [@yozora/tokenizer-image]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/image#readme
274
- [@yozora/tokenizer-image-reference]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/image-reference#readme
275
- [@yozora/tokenizer-indented-code]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/indented-code#readme
276
- [@yozora/tokenizer-inline-code]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/inline-code#readme
277
- [@yozora/tokenizer-inline-math]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/inline-math#readme
278
- [@yozora/tokenizer-link]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/link#readme
279
- [@yozora/tokenizer-link-reference]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/link-reference#readme
280
- [@yozora/tokenizer-list]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/list#readme
281
- [@yozora/tokenizer-math]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/math#readme
282
- [@yozora/tokenizer-paragraph]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/paragraph#readme
283
- [@yozora/tokenizer-setext-heading]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/setext-heading#readme
284
- [@yozora/tokenizer-table]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/table#readme
285
- [@yozora/tokenizer-text]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/text#readme
286
- [@yozora/tokenizer-thematic-break]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/thematic-break#readme
256
+ [@yozora/tokenizer-admonition]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/admonition#readme
257
+ [@yozora/tokenizer-autolink]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/autolink#readme
258
+ [@yozora/tokenizer-autolink-extension]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/autolink-extension#readme
259
+ [@yozora/tokenizer-blockquote]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/blockquote#readme
260
+ [@yozora/tokenizer-break]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/break#readme
261
+ [@yozora/tokenizer-definition]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/definition#readme
262
+ [@yozora/tokenizer-delete]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/delete#readme
263
+ [@yozora/tokenizer-ecma-import]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/ecma-import#readme
264
+ [@yozora/tokenizer-emphasis]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/emphasis#readme
265
+ [@yozora/tokenizer-fenced-block]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/fenced-block#readme
266
+ [@yozora/tokenizer-fenced-code]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/fenced-code#readme
267
+ [@yozora/tokenizer-footnote]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/footnote#readme
268
+ [@yozora/tokenizer-footnote-definition]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/footnote-definition#readme
269
+ [@yozora/tokenizer-footnote-reference]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/footnote-reference#readme
270
+ [@yozora/tokenizer-heading]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/heading#readme
271
+ [@yozora/tokenizer-html-block]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/html-block#readme
272
+ [@yozora/tokenizer-html-inline]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/html-inline#readme
273
+ [@yozora/tokenizer-image]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/image#readme
274
+ [@yozora/tokenizer-image-reference]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/image-reference#readme
275
+ [@yozora/tokenizer-indented-code]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/indented-code#readme
276
+ [@yozora/tokenizer-inline-code]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/inline-code#readme
277
+ [@yozora/tokenizer-inline-math]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/inline-math#readme
278
+ [@yozora/tokenizer-link]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/link#readme
279
+ [@yozora/tokenizer-link-reference]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/link-reference#readme
280
+ [@yozora/tokenizer-list]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/list#readme
281
+ [@yozora/tokenizer-math]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/math#readme
282
+ [@yozora/tokenizer-paragraph]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/paragraph#readme
283
+ [@yozora/tokenizer-setext-heading]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/setext-heading#readme
284
+ [@yozora/tokenizer-table]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/table#readme
285
+ [@yozora/tokenizer-text]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/text#readme
286
+ [@yozora/tokenizer-thematic-break]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/thematic-break#readme
287
287
 
288
288
  [@yozora/react-admonition]: https://github.com/yozorajs/yozora-react/tree/main/packages/admonition#readme
289
289
  [@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-footnote-definition",
3
- "version": "2.1.3",
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
- "src/",
30
+ "!lib/**/*.map",
31
31
  "package.json",
32
32
  "CHANGELOG.md",
33
33
  "LICENSE",
@@ -39,9 +39,9 @@
39
39
  "test": "cross-env TS_NODE_FILES=true NODE_OPTIONS=--experimental-vm-modules jest --config ../../jest.config.mjs --rootDir ."
40
40
  },
41
41
  "dependencies": {
42
- "@yozora/ast": "^2.1.3",
43
- "@yozora/character": "^2.1.3",
44
- "@yozora/core-tokenizer": "^2.1.3"
42
+ "@yozora/ast": "^2.1.5",
43
+ "@yozora/character": "^2.1.5",
44
+ "@yozora/core-tokenizer": "^2.1.5"
45
45
  },
46
- "gitHead": "9abaaff74a12d0bae0f645813241ff947a0d828c"
46
+ "gitHead": "4f753bcf0fd921938464802462dc48c53bbd014d"
47
47
  }
package/src/index.ts DELETED
@@ -1,10 +0,0 @@
1
- export * from './util'
2
- export { match as footnoteDefinitionMatch } from './match'
3
- export { parse as footnoteDefinitionParse } from './parse'
4
- export { FootnoteDefinitionTokenizer, FootnoteDefinitionTokenizer as default } from './tokenizer'
5
- export { uniqueName as FootnoteDefinitionTokenizerName } from './types'
6
- export type {
7
- IThis as IFootnoteDefinitionHookContext,
8
- IToken as IFootnoteDefinitionToken,
9
- ITokenizerProps as IFootnoteDefinitionTokenizerProps,
10
- } from './types'
package/src/match.ts DELETED
@@ -1,115 +0,0 @@
1
- import { FootnoteDefinitionType } from '@yozora/ast'
2
- import { AsciiCodePoint, calcStringFromNodePoints } from '@yozora/character'
3
- import type {
4
- IMatchBlockHookCreator,
5
- IPhrasingContentLine,
6
- IResultOfEatContinuationText,
7
- IResultOfEatOpener,
8
- IResultOfOnClose,
9
- } from '@yozora/core-tokenizer'
10
- import { calcEndPoint, calcStartPoint, resolveLabelToIdentifier } from '@yozora/core-tokenizer'
11
- import type { IThis, IToken, T } from './types'
12
- import { eatFootnoteLabel } from './util'
13
-
14
- /**
15
- * A footnote reference definition consists of a footnote label, indented up
16
- * to three spaces, followed by a colon (:), optional whitespace (including up
17
- * to one line ending), a footnote contents consisted by paragraph-like strings.
18
- *
19
- * Unlike the link label, the footnote label should be on the same line and it
20
- * begins with a left bracket ([) followed by a caret (^), and ends with the
21
- * first right bracket (]) that is not backslash-escaped. Between the caret of
22
- * right bracket, there must be at least one non-whitespace character.
23
- * Unescaped square bracket characters are not allowed inside the opening creat
24
- * and closing square bracket of footnote labels. A footnote label can have at
25
- * most 999 characters inside the caret and right bracket.
26
- *
27
- * @see https://github.github.com/gfm/#link-label
28
- * @see https://github.github.com/gfm/#link-reference-definition
29
- * @see https://github.com/syntax-tree/mdast-util-footnote
30
- * @see https://github.com/remarkjs/remark-footnotes
31
- * @see https://www.markdownguide.org/extended-syntax/#footnotes
32
- */
33
- export const match: IMatchBlockHookCreator<T, IToken, IThis> = function (api) {
34
- const { indent } = this
35
- return {
36
- isContainingBlock: true,
37
- eatOpener,
38
- eatContinuationText,
39
- onClose,
40
- }
41
-
42
- function eatOpener(line: Readonly<IPhrasingContentLine>): IResultOfEatOpener<T, IToken> {
43
- if (line.countOfPrecedeSpaces >= 4) return null
44
-
45
- const { nodePoints, startIndex, firstNonWhitespaceIndex, endIndex } = line
46
- const nextIndex = eatFootnoteLabel(nodePoints, firstNonWhitespaceIndex, endIndex)
47
-
48
- // Try to match the following colon (:).
49
- if (
50
- nextIndex < 0 ||
51
- nextIndex >= endIndex ||
52
- nodePoints[nextIndex].codePoint !== AsciiCodePoint.COLON
53
- ) {
54
- return null
55
- }
56
-
57
- const token: IToken = {
58
- nodeType: FootnoteDefinitionType,
59
- position: {
60
- start: calcStartPoint(nodePoints, startIndex),
61
- end: calcEndPoint(nodePoints, nextIndex),
62
- },
63
- label: {
64
- nodePoints,
65
- startIndex: firstNonWhitespaceIndex,
66
- endIndex: nextIndex,
67
- },
68
- children: [],
69
- }
70
- return { token, nextIndex: nextIndex + 1 }
71
- }
72
-
73
- function eatContinuationText(line: Readonly<IPhrasingContentLine>): IResultOfEatContinuationText {
74
- const { startIndex, endIndex, firstNonWhitespaceIndex, countOfPrecedeSpaces } = line
75
-
76
- // Blank line is allowed
77
- if (firstNonWhitespaceIndex >= endIndex) {
78
- return {
79
- status: 'opening',
80
- nextIndex: Math.min(endIndex - 1, startIndex + indent),
81
- }
82
- }
83
-
84
- // Indent of a non-blank line is required.
85
- if (countOfPrecedeSpaces >= indent) {
86
- return { status: 'opening', nextIndex: startIndex + indent }
87
- }
88
-
89
- return { status: 'notMatched' }
90
- }
91
-
92
- function onClose(token: IToken): IResultOfOnClose {
93
- /**
94
- * Labels are trimmed and case-insensitive
95
- * @see https://github.github.com/gfm/#example-174
96
- * @see https://github.github.com/gfm/#example-175
97
- */
98
- const label = calcStringFromNodePoints(
99
- token.label.nodePoints,
100
- token.label.startIndex + 2,
101
- token.label.endIndex - 1,
102
- )
103
- const identifier = resolveLabelToIdentifier(label)
104
-
105
- // Register definition identifier.
106
- api.registerFootnoteDefinitionIdentifier(identifier)
107
-
108
- // Cache label and identifier for performance.
109
-
110
- // eslint-disable-next-line no-param-reassign
111
- token._label = label
112
- // eslint-disable-next-line no-param-reassign
113
- token._identifier = identifier
114
- }
115
- }
package/src/parse.ts DELETED
@@ -1,31 +0,0 @@
1
- import type { Node } from '@yozora/ast'
2
- import { FootnoteDefinitionType } from '@yozora/ast'
3
- import type { IParseBlockHookCreator } from '@yozora/core-tokenizer'
4
- import type { INode, IThis, IToken, T } from './types'
5
-
6
- export const parse: IParseBlockHookCreator<T, IToken, INode, IThis> = function (api) {
7
- return {
8
- parse: tokens =>
9
- tokens.map(token => {
10
- const label: string = token._label!
11
- const identifier: string = token._identifier!
12
-
13
- const children: Node[] = api.parseBlockTokens(token.children)
14
- const node: INode = api.shouldReservePosition
15
- ? {
16
- type: FootnoteDefinitionType,
17
- position: token.position,
18
- identifier,
19
- label,
20
- children,
21
- }
22
- : {
23
- type: FootnoteDefinitionType,
24
- identifier,
25
- label,
26
- children,
27
- }
28
- return node
29
- }),
30
- }
31
- }
package/src/tokenizer.ts DELETED
@@ -1,37 +0,0 @@
1
- import type {
2
- IBlockTokenizer,
3
- IMatchBlockHookCreator,
4
- IParseBlockHookCreator,
5
- } from '@yozora/core-tokenizer'
6
- import { BaseBlockTokenizer, TokenizerPriority } from '@yozora/core-tokenizer'
7
- import { match } from './match'
8
- import { parse } from './parse'
9
- import type { INode, IThis, IToken, ITokenizerProps, T } from './types'
10
- import { uniqueName } from './types'
11
-
12
- /**
13
- * Lexical Analyzer for FootnoteDefinition.
14
- * @see https://github.github.com/gfm/#link-label
15
- * @see https://github.github.com/gfm/#link-reference-definition
16
- * @see https://github.com/syntax-tree/mdast-util-footnote
17
- * @see https://github.com/remarkjs/remark-footnotes
18
- * @see https://www.markdownguide.org/extended-syntax/#footnotes
19
- */
20
- export class FootnoteDefinitionTokenizer
21
- extends BaseBlockTokenizer<T, IToken, INode, IThis>
22
- implements IBlockTokenizer<T, IToken, INode, IThis>
23
- {
24
- /* istanbul ignore next */
25
- constructor(props: ITokenizerProps = {}) {
26
- super({
27
- name: props.name ?? uniqueName,
28
- priority: props.priority ?? TokenizerPriority.CONTAINING_BLOCK,
29
- })
30
- }
31
-
32
- public readonly indent = 4
33
-
34
- public override readonly match: IMatchBlockHookCreator<T, IToken, IThis> = match
35
-
36
- public override readonly parse: IParseBlockHookCreator<T, IToken, INode, IThis> = parse
37
- }
package/src/types.ts DELETED
@@ -1,37 +0,0 @@
1
- import type { FootnoteDefinition, FootnoteDefinitionType } from '@yozora/ast'
2
- import type { INodeInterval, INodePoint } from '@yozora/character'
3
- import type {
4
- IBaseBlockTokenizerProps,
5
- IBlockToken,
6
- IPartialBlockToken,
7
- ITokenizer,
8
- } from '@yozora/core-tokenizer'
9
-
10
- export type T = FootnoteDefinitionType
11
- export type INode = FootnoteDefinition
12
- export const uniqueName = '@yozora/tokenizer-footnote-definition'
13
-
14
- export interface IToken extends IPartialBlockToken<T> {
15
- /**
16
- * Footnote label
17
- */
18
- label: INodeInterval & { nodePoints: ReadonlyArray<INodePoint> }
19
- /**
20
- *
21
- */
22
- children: IBlockToken[]
23
- /**
24
- * Resolved definition label.
25
- */
26
- _label?: string
27
- /**
28
- * Resolved definition identifier.
29
- */
30
- _identifier?: string
31
- }
32
-
33
- export interface IThis extends ITokenizer {
34
- indent: number
35
- }
36
-
37
- export type ITokenizerProps = Partial<IBaseBlockTokenizerProps>
package/src/util.ts DELETED
@@ -1,58 +0,0 @@
1
- import type { INodePoint } from '@yozora/character'
2
- import { AsciiCodePoint, VirtualCodePoint, isWhitespaceCharacter } from '@yozora/character'
3
-
4
- /**
5
- * Try to match a footnote label.
6
- *
7
- * Unlike the link label, the footnote label should be on the same line and it
8
- * begins with a left bracket ([) followed by a caret (^), and ends with the
9
- * first right bracket (]) that is not backslash-escaped. Between the caret of
10
- * right bracket, there must be at least one non-whitespace character.
11
- * Unescaped square bracket characters are not allowed inside the opening creat
12
- * and closing square bracket of footnote labels. A footnote label can have at
13
- * most 999 characters inside the caret and right bracket.
14
- *
15
- * @param nodePoints
16
- * @param firstNonWhitespaceIndex
17
- * @param endIndex
18
- * @see https://github.github.com/gfm/#link-label
19
- */
20
- export function eatFootnoteLabel(
21
- nodePoints: ReadonlyArray<INodePoint>,
22
- firstNonWhitespaceIndex: number,
23
- endIndex: number,
24
- ): number {
25
- let i = firstNonWhitespaceIndex
26
-
27
- // Try to match an opening delimiter of a footnote label.
28
- if (
29
- i + 1 >= endIndex ||
30
- nodePoints[i].codePoint !== AsciiCodePoint.OPEN_BRACKET ||
31
- nodePoints[i + 1].codePoint !== AsciiCodePoint.CARET
32
- ) {
33
- return -1
34
- }
35
-
36
- let isEmpty = true
37
- const lastIndex = Math.min(endIndex, i + 1 + 1000)
38
- for (i += 2; i < lastIndex; ++i) {
39
- const c = nodePoints[i].codePoint
40
- switch (c) {
41
- case AsciiCodePoint.BACKSLASH:
42
- i += 1
43
- break
44
- case AsciiCodePoint.OPEN_BRACKET:
45
- return -1
46
- case AsciiCodePoint.CLOSE_BRACKET:
47
- return isEmpty ? -1 : i + 1
48
- case VirtualCodePoint.LINE_END:
49
- return -1
50
- default:
51
- if (isEmpty && !isWhitespaceCharacter(c)) {
52
- isEmpty = false
53
- }
54
- }
55
- }
56
-
57
- return -1
58
- }