@yozora/tokenizer-inline-math 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,536 @@
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
+ ### Bug Fixes
130
+
131
+ * 🐛 replace line-ending to whitespace ([1ed9857](https://github.com/yozorajs/yozora/commit/1ed9857f618d8ef7742432d3bb1d8317fc9186f2))
132
+
133
+
134
+ ### Performance Improvements
135
+
136
+ * ✅ refactor test utils & rename createTester to createTokenizerTester ([7f2ce75](https://github.com/yozorajs/yozora/commit/7f2ce7571a336370d419aa01073bf8054783cfd9))
137
+ * 🔖 publish v2.0.1 ([3aea330](https://github.com/yozorajs/yozora/commit/3aea33091e402bd6c7754d91d549e8d648475073))
138
+
139
+
140
+
141
+ # 2.0.0 (2022-01-15)
142
+
143
+
144
+ ### Performance Improvements
145
+
146
+ * 🔖 publish v2.0.0 ([65e99d1](https://github.com/yozorajs/yozora/commit/65e99d1709fdd1c918465dce6b1e91de96bdab5e))
147
+
148
+
149
+
150
+ # 2.0.0-alpha.3 (2022-01-12)
151
+
152
+
153
+ ### Features
154
+
155
+ * 💥 [breaking] remove 'I' prefix for AST node types ([cad4b0b](https://github.com/yozorajs/yozora/commit/cad4b0b5b8061ea495f6455ef1554bb3c8f223a0))
156
+
157
+
158
+ ### Performance Improvements
159
+
160
+ * 🔖 publish v2.0.0-alpha.3 ([9f274fc](https://github.com/yozorajs/yozora/commit/9f274fc7487a8c1dd213405d92508f9a7621f730))
161
+
162
+
163
+
164
+ # 2.0.0-alpha.2 (2022-01-09)
165
+
166
+
167
+ ### Performance Improvements
168
+
169
+ * 🎨 refactor parse-inline hooks ([455cfbd](https://github.com/yozorajs/yozora/commit/455cfbdfec9f3d7a738d0b3f23655805b1eaea0b))
170
+ * 🎨 refactor removePosition ([87a974f](https://github.com/yozorajs/yozora/commit/87a974fd744ae937d5778d3cdba4b345141bcaf6))
171
+ * 🔖 publish v2.0.0-alpha.2 ([da59d85](https://github.com/yozorajs/yozora/commit/da59d85520455c59a117a35032ef1a035c10ea21))
172
+
173
+
174
+
175
+ # 2.0.0-alpha.1 (2022-01-08)
176
+
177
+
178
+ ### Bug Fixes
179
+
180
+ * 🐛 fix incorrect export names ([b2d1fa7](https://github.com/yozorajs/yozora/commit/b2d1fa71d774bd78c87aa51435ba89593ebbeb24))
181
+
182
+
183
+ ### Performance Improvements
184
+
185
+ * 🎨 refactor inline tokenizers ([b3ff235](https://github.com/yozorajs/yozora/commit/b3ff235f31f18e6ae511aaa4f96919f4eb90fa5c))
186
+ * 🔖 publish v2.0.0-alpha.1 ([86202e1](https://github.com/yozorajs/yozora/commit/86202e1d2b03ccfc2ab030517d9d314f7aee7666))
187
+ * 🎨 rename IHookContext to IThis ([04d5470](https://github.com/yozorajs/yozora/commit/04d5470c9949c4acfe6239289d34a8b5c6191e71))
188
+ * 📝 update READMEs ([320afeb](https://github.com/yozorajs/yozora/commit/320afebd6c500cbbce5fd65c1cd184bbd2224f25))
189
+
190
+
191
+
192
+ # 2.0.0-alpha.0 (2022-01-03)
193
+
194
+
195
+ ### Features
196
+
197
+ * 💥 [breaking] rename types with 'I' prefix ([d37d862](https://github.com/yozorajs/yozora/commit/d37d862212831dbe75ac92a6dbdadf2fa81cce8c))
198
+
199
+
200
+ ### Performance Improvements
201
+
202
+ * 💥 refactor inline tokenizers ([85e2d65](https://github.com/yozorajs/yozora/commit/85e2d655baf1e4f2010cbf9d80ed3a4f2d390d5c))
203
+ * 🔖 publish v2.0.0-alpha.0 ([0171501](https://github.com/yozorajs/yozora/commit/0171501339c49ffd02ed16a63447fa20a47a29a7))
204
+ * 🎨 rename parser hooks ([ef6cbc5](https://github.com/yozorajs/yozora/commit/ef6cbc51323e6ef9d4cd78f1c7194ae1f7819245))
205
+ * 🎨 set print width to 100 ([657a621](https://github.com/yozorajs/yozora/commit/657a6211cad52d5f1b183e7bcd7ea227b2aa7724))
206
+
207
+
208
+
209
+ # 1.3.0 (2021-10-09)
210
+
211
+
212
+ ### Features
213
+
214
+ * 💥 move func parameter `nodePoints` to api.getNodePoints() ([6bbfd4e](https://github.com/yozorajs/yozora/commit/6bbfd4e9c57240eeca0acb01a0bbc83c0eafa978))
215
+ * 💥 move func parameter `nodePoints` to api.getNodePoints() ([10e5033](https://github.com/yozorajs/yozora/commit/10e503332b40dac35be93878d6763051e7022352))
216
+
217
+
218
+ ### Performance Improvements
219
+
220
+ * 🔖 publish v1.3.0 ([18c9b16](https://github.com/yozorajs/yozora/commit/18c9b167004ad97718b2f94f25139f80598cbf7a))
221
+ * 🎨 set the default `children` to empty array instead of undefined ([8fe26ca](https://github.com/yozorajs/yozora/commit/8fe26ca085ec7d48148895fddbec019a84c24a8a))
222
+
223
+
224
+
225
+ ## 1.2.2 (2021-09-06)
226
+
227
+
228
+ ### Performance Improvements
229
+
230
+ * 🔖 publish v1.2.2 ([fb4b804](https://github.com/yozorajs/yozora/commit/fb4b804548592c09259aabcf9cc4dd96176bd024))
231
+
232
+
233
+
234
+ ## 1.2.1 (2021-09-04)
235
+
236
+
237
+ ### Performance Improvements
238
+
239
+ * 🔖 publish v1.2.1 ([d98d07d](https://github.com/yozorajs/yozora/commit/d98d07d7c56dd9f6bb60149b2b0a4be2787e1046))
240
+
241
+
242
+
243
+ # 1.2.0 (2021-08-22)
244
+
245
+
246
+ ### Performance Improvements
247
+
248
+ * 🔖 publish v1.2.0 ([86da40e](https://github.com/yozorajs/yozora/commit/86da40e50d2fe9acace68695288e15e012e6cd0d))
249
+
250
+
251
+
252
+ # 1.2.0-alpha.1 (2021-08-16)
253
+
254
+
255
+ ### Performance Improvements
256
+
257
+ * 🔖 publish v1.2.0-alpha.1 ([ce3c173](https://github.com/yozorajs/yozora/commit/ce3c17330085f22404668a388f2bee6f57e6e958))
258
+
259
+
260
+
261
+ # 1.2.0-alpha.0 (2021-08-15)
262
+
263
+
264
+ ### Performance Improvements
265
+
266
+ * 🔖 publish v1.2.0-alpha.0 ([bd8ef45](https://github.com/yozorajs/yozora/commit/bd8ef455a22963834a70339f42178138aab28df6))
267
+
268
+
269
+
270
+ # 1.1.0 (2021-08-12)
271
+
272
+
273
+ ### Performance Improvements
274
+
275
+ * 🔖 publish v1.1.0 ([a8c7cff](https://github.com/yozorajs/yozora/commit/a8c7cffcbdc36930ab3c744450c8feb4395a9fac))
276
+ * 📝 update related references ([e2c8c7e](https://github.com/yozorajs/yozora/commit/e2c8c7e6ff8c5c1da27ca224d5c5d0eb4e5fbca7))
277
+
278
+
279
+
280
+ # 1.1.0-alpha.2 (2021-08-07)
281
+
282
+
283
+ ### Performance Improvements
284
+
285
+ * 🔖 publish v1.1.0-alpha.2 ([d88b8ec](https://github.com/yozorajs/yozora/commit/d88b8eca03118b9f2a8b00ac4106ea82e779bc94))
286
+
287
+
288
+
289
+ # 1.1.0-alpha.1 (2021-08-01)
290
+
291
+
292
+ ### Performance Improvements
293
+
294
+ * 🔖 publish v1.1.0-alpha.1 ([0d6aa91](https://github.com/yozorajs/yozora/commit/0d6aa91fb5a15b962b016496453dbfa7f1197126))
295
+ * 📝 update READMEs ([738d626](https://github.com/yozorajs/yozora/commit/738d626d76c535ea017812f674b43842ee073227))
296
+
297
+
298
+
299
+ # 1.1.0-alpha.0 (2021-07-31)
300
+
301
+
302
+ ### Performance Improvements
303
+
304
+ * 🔖 publish v1.1.0-alpha.0 ([082653e](https://github.com/yozorajs/yozora/commit/082653e421889513588492774503d8ddcc24b8f9))
305
+ * 📝 update READMEs ([9905f04](https://github.com/yozorajs/yozora/commit/9905f0408b15d4478d021ef5c75497817f2db9a3))
306
+ * 📝 update READMEs ([03fe64c](https://github.com/yozorajs/yozora/commit/03fe64c6a9eab9bf810d4648261e7a808a13d1e1))
307
+
308
+
309
+
310
+ # 1.0.0 (2021-07-20)
311
+
312
+
313
+ ### Performance Improvements
314
+
315
+ * 🔖 publish v1.0.0 ([ad754e3](https://github.com/yozorajs/yozora/commit/ad754e3a5945cd2ce19d9e6bfa59cb82caf0c7ac))
316
+
317
+
318
+
319
+ # 1.0.0-beta.0 (2021-07-08)
320
+
321
+
322
+ ### Performance Improvements
323
+
324
+ * 🔖 publish v1.0.0-beta.0 ([bb66320](https://github.com/yozorajs/yozora/commit/bb6632098367cd8cf391eb1380d4542c15383bac))
325
+
326
+
327
+
328
+ # 1.0.0-1.0.0-beta.0.0 (2021-07-08)
329
+
330
+
331
+ ### Performance Improvements
332
+
333
+ * 🔖 publish v1.0.0-1.0.0-beta.0.0 ([4051dd2](https://github.com/yozorajs/yozora/commit/4051dd2bcdea0d051141abaa85635e52d84c04f2))
334
+ * 📝 update READMEs ([9d9f940](https://github.com/yozorajs/yozora/commit/9d9f940a81188502db6045134054b18b747819bf))
335
+
336
+
337
+
338
+ # 1.0.0-alpha.29 (2021-07-08)
339
+
340
+
341
+ ### Performance Improvements
342
+
343
+ * expose new utility func 'createTester' and 'createTesters' ([a4e9613](https://github.com/yozorajs/yozora/commit/a4e9613063e3e5840cf066e6e7343dbd5ffd4884))
344
+ * 📝 fix invalid link references ([f7b97b3](https://github.com/yozorajs/yozora/commit/f7b97b3dc74f065aa8f00ecd846ee4fa7f704453))
345
+ * 🔖 publish v1.0.0-alpha.29 ([f2291db](https://github.com/yozorajs/yozora/commit/f2291db2812043dd6586eaabd14e427abb11663a))
346
+ * 🎨 use path alias in tests ([29cca94](https://github.com/yozorajs/yozora/commit/29cca943d4fbc6d26af4507d3fa75ac08dcf388a))
347
+
348
+
349
+
350
+ # 1.0.0-alpha.28 (2021-06-30)
351
+
352
+
353
+ ### Performance Improvements
354
+
355
+ * 🔖 publish v1.0.0-alpha.28 ([f18d90a](https://github.com/yozorajs/yozora/commit/f18d90a116db508bf49c9a3338a262cb85faf792))
356
+
357
+
358
+
359
+ # 1.0.0-alpha.27 (2021-06-28)
360
+
361
+
362
+ ### Performance Improvements
363
+
364
+ * 🎨 update base abstract tokenizer ([cca9dd6](https://github.com/yozorajs/yozora/commit/cca9dd6fc3d4a22e1352378f59c7d2dccecfc5a2))
365
+ * 🔖 publish v1.0.0-alpha.27 ([8efea07](https://github.com/yozorajs/yozora/commit/8efea07b2314c241c91fc113abdc8852f216c9d7))
366
+ * ⬆️ upgrade dev dependencies ([d126ff4](https://github.com/yozorajs/yozora/commit/d126ff4c81ec09b366a0c60ba2a83e7f45fbe317))
367
+
368
+
369
+
370
+ # 1.0.0-alpha.26 (2021-06-25)
371
+
372
+
373
+ ### Performance Improvements
374
+
375
+ * 🔖 publish v1.0.0-alpha.26 ([cbde29c](https://github.com/yozorajs/yozora/commit/cbde29c6188c9183f0b39ccfac0ad310803b09fe))
376
+ * 📝 update READMEs ([11e4f61](https://github.com/yozorajs/yozora/commit/11e4f6107c3862bf8c81dae882e93cab3f56f40f))
377
+
378
+
379
+
380
+ # 1.0.0-alpha.25 (2021-06-17)
381
+
382
+
383
+ ### Performance Improvements
384
+
385
+ * 🔖 publish v1.0.0-alpha.25 ([5e17f71](https://github.com/yozorajs/yozora/commit/5e17f7155391c21eb1c99e5024e48d5e208e80db))
386
+ * ⚰️ remove delimiterGroup as we are no longer need it ([e9de208](https://github.com/yozorajs/yozora/commit/e9de208eca035d874e1909869ab52a0a5201dd2f))
387
+ * 🎨 rewrite due to the algorithm changed ([7216611](https://github.com/yozorajs/yozora/commit/7216611d79f9f10faaf913500341b796a58c6b1b))
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
+ ### Performance Improvements
454
+
455
+ * 🎨 support new member method 'replaceTokenizer' ([67e7085](https://github.com/yozorajs/yozora/commit/67e70852dfc67882659981398713e34b27e71aad))
456
+ * 🔖 publish v1.0.0-alpha.18 ([219b28b](https://github.com/yozorajs/yozora/commit/219b28b38975d6d41f6c285a512a5c0dccceb6fa))
457
+
458
+
459
+
460
+ # 1.0.0-alpha.17 (2021-04-15)
461
+
462
+
463
+ ### Performance Improvements
464
+
465
+ * :construction: [inline-math] feat: support new option 'backtickRequired' ([e10e074](https://github.com/yozorajs/yozora/commit/e10e074312529218f3f56e96de7327cff9c77158))
466
+ * 🎨 optimize duplicate codes ([347ae9b](https://github.com/yozorajs/yozora/commit/347ae9b897aeeee8a6c73280660e2bd1878c113e))
467
+ * 🔖 publish v1.0.0-alpha.17 ([0e7facd](https://github.com/yozorajs/yozora/commit/0e7facdde8692e538e5777d70b873cf6282f7de8))
468
+ * :whitespace_check_mark: udpate tests ([6910b98](https://github.com/yozorajs/yozora/commit/6910b987aa7c50759cabf29ce49d40b9238e108d))
469
+ * 📝 update docs ([acffd75](https://github.com/yozorajs/yozora/commit/acffd757123705c4d0f6a3948f62f3c460cefde3))
470
+
471
+
472
+
473
+ # 1.0.0-alpha.16 (2021-04-12)
474
+
475
+
476
+ ### Performance Improvements
477
+
478
+ * ✅ collect all test cases in the scaffolds/jest-for-tokenizer/fixtures/ directory ([a328ffd](https://github.com/yozorajs/yozora/commit/a328ffd8c11d8e49ec6cc378057b01448ed09300))
479
+ * 🔖 publish v1.0.0-alpha.16 ([9da34dd](https://github.com/yozorajs/yozora/commit/9da34dd46333b72f908c77d15f11326f3724060c))
480
+ * ✅ simplify test codes ([60d072c](https://github.com/yozorajs/yozora/commit/60d072c6bf4a414e45b3d98713223a23be5d0bb8))
481
+
482
+
483
+
484
+ # 1.0.0-alpha.15 (2021-04-11)
485
+
486
+
487
+ ### Performance Improvements
488
+
489
+ * 🔖 publish v1.0.0-alpha.15 ([988d25f](https://github.com/yozorajs/yozora/commit/988d25f7958825ccbaaa99051ad7b823c625d4cf))
490
+
491
+
492
+
493
+ # 1.0.0-alpha.14 (2021-04-11)
494
+
495
+
496
+ ### Performance Improvements
497
+
498
+ * 🔖 publish v1.0.0-alpha.14 ([3fcfffa](https://github.com/yozorajs/yozora/commit/3fcfffa0da0413449acf0d91d85400d0b31fa9a2))
499
+ * 🎨 rename isContainerBlock to isContainingBlock & use enum TokenizerPriority instead of magic numbers to present tokenizer proirity ([940c50b](https://github.com/yozorajs/yozora/commit/940c50bb58b76a888a512539f3a4db6e8396d45b))
500
+ * 🎨 support to specify which tokenizer to register before ([e8607f4](https://github.com/yozorajs/yozora/commit/e8607f41e2a52d3de91463080ac3ac52968e5f51))
501
+ * 🎨 tweak parser interfaces ([218008e](https://github.com/yozorajs/yozora/commit/218008e5268da489b01306dfa0f871e8a6cc6c3c))
502
+ * 📝 update READMEs ([8c0ff37](https://github.com/yozorajs/yozora/commit/8c0ff379692517bb9aa9f3712c99875eaef55ec2))
503
+ * ✅ update tests ([3c9f64f](https://github.com/yozorajs/yozora/commit/3c9f64f331d2b2c3484cc580dc8ef13e21ee42b8))
504
+ * ✅ update tests ([a24d148](https://github.com/yozorajs/yozora/commit/a24d1485b59caaeff4510b1150d8810236a9906a))
505
+
506
+
507
+
508
+ # 1.0.0-alpha.13 (2021-04-10)
509
+
510
+
511
+ ### Performance Improvements
512
+
513
+ * 🎨 add api for match-inline and parse-inline phase ([150231a](https://github.com/yozorajs/yozora/commit/150231af44b14db614c0823c05e94ba58e096cb3))
514
+ * 🎨 expose new func `isSpaceCharacter` from @yozora/character ([a4ed590](https://github.com/yozorajs/yozora/commit/a4ed5905272660f42374c6f627749dfeb2d04b61))
515
+ * 🔖 publish v1.0.0-alpha.13 ([949455c](https://github.com/yozorajs/yozora/commit/949455c25f4fb60a88c3484829a610da7c998969))
516
+ * 📝 update READMEs ([5dbe7bb](https://github.com/yozorajs/yozora/commit/5dbe7bb333e9e59c20fb4323d35fd6eb1c0ecd3f))
517
+
518
+
519
+
520
+ # 1.0.0-alpha.12 (2021-03-27)
521
+
522
+
523
+ ### Features
524
+
525
+ * 💥 redesign interfaces & refactor tokenizer codes with types from @yozora/ast ([af3603d](https://github.com/yozorajs/yozora/commit/af3603d771bde94ec0c78fb53aa6d64a14933f9d))
526
+
527
+
528
+ ### Performance Improvements
529
+
530
+ * 🎨 add static uniqueName into tokenizers ([f6e2c77](https://github.com/yozorajs/yozora/commit/f6e2c77b864c2ef05af0084025d999b4419d8095))
531
+ * 🎨 use AST types from @yozora/ast & add uniqueName to tokenizer & update tests ([6bc8f49](https://github.com/yozorajs/yozora/commit/6bc8f498aa41b5f15cc804e27ae87356cfbcc451))
532
+ * 🎨 make '_tokenizer' optional in the result of tokenizers on match phase ([b1ea8de](https://github.com/yozorajs/yozora/commit/b1ea8de5a439615d09e9cc3585b1a3cbdb663d31))
533
+ * 🔧 update script fields ([48a57ec](https://github.com/yozorajs/yozora/commit/48a57ec8f92b5cffb02e24b0b2ee94364033226f))
534
+ * 🔖 publish v1.0.0-alpha.12 ([897f131](https://github.com/yozorajs/yozora/commit/897f1317408ab43406788d5b796d245fd4eeac13))
535
+ * 💥 rename @yozora/inline-formula to @yozora/inline-math ([d0d5dd6](https://github.com/yozorajs/yozora/commit/d0d5dd65aa513b3635f30f30838cd7f11c9379c7))
536
+ * ✅ update tests due to the previous changes ([24bb714](https://github.com/yozorajs/yozora/commit/24bb714196ed762db2a08ca893ef13d06b331284))
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/inline-math#readme">@yozora/tokenizer-inline-math</a>
5
+ <a href="https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/inline-math#readme">@yozora/tokenizer-inline-math</a>
6
6
  </h1>
7
7
  <div align="center">
8
8
  <a href="https://www.npmjs.com/package/@yozora/tokenizer-inline-math">
@@ -187,53 +187,53 @@ Name | Type | Required | Default
187
187
 
188
188
  [live-examples]: https://yozora.guanghechen.com/docs/package/tokenizer-inline-math#live-examples
189
189
  [docpage]: https://yozora.guanghechen.com/docs/package/tokenizer-inline-math
190
- [homepage]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/inline-math#readme
190
+ [homepage]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/inline-math#readme
191
191
  [gfm-spec]: https://github.github.com/gfm
192
192
  [mdast-homepage]: https://github.com/syntax-tree/mdast
193
193
 
194
- [@yozora/ast]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/ast#readme
195
- [@yozora/ast-util]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/ast-util#readme
196
- [@yozora/character]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/character#readme
194
+ [@yozora/ast]: https://github.com/yozorajs/yozora/tree/v2.1.5/packages/ast#readme
195
+ [@yozora/ast-util]: https://github.com/yozorajs/yozora/tree/v2.1.5/packages/ast-util#readme
196
+ [@yozora/character]: https://github.com/yozorajs/yozora/tree/v2.1.5/packages/character#readme
197
197
  [@yozora/eslint-config]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/eslint-config#readme
198
- [@yozora/core-parser]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/core-parser#readme
199
- [@yozora/core-tokenizer]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/core-tokenizer#readme
200
- [@yozora/invariant]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/invariant#readme
198
+ [@yozora/core-parser]: https://github.com/yozorajs/yozora/tree/v2.1.5/packages/core-parser#readme
199
+ [@yozora/core-tokenizer]: https://github.com/yozorajs/yozora/tree/v2.1.5/packages/core-tokenizer#readme
200
+ [@yozora/invariant]: https://github.com/yozorajs/yozora/tree/v2.1.5/packages/invariant#readme
201
201
  [@yozora/jest-for-tokenizer]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/jest-for-tokenizer#readme
202
- [@yozora/parser]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/parser#readme
203
- [@yozora/parser-gfm]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/parser-gfm#readme
204
- [@yozora/parser-gfm-ex]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/parser-gfm-ex#readme
202
+ [@yozora/parser]: https://github.com/yozorajs/yozora/tree/v2.1.5/packages/parser#readme
203
+ [@yozora/parser-gfm]: https://github.com/yozorajs/yozora/tree/v2.1.5/packages/parser-gfm#readme
204
+ [@yozora/parser-gfm-ex]: https://github.com/yozorajs/yozora/tree/v2.1.5/packages/parser-gfm-ex#readme
205
205
  [@yozora/template-tokenizer]: https://github.com/yozorajs/yozora/tree/release-2.x.x/packages/template-tokenizer#readme
206
- [@yozora/tokenizer-admonition]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/admonition#readme
207
- [@yozora/tokenizer-autolink]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/autolink#readme
208
- [@yozora/tokenizer-autolink-extension]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/autolink-extension#readme
209
- [@yozora/tokenizer-blockquote]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/blockquote#readme
210
- [@yozora/tokenizer-break]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/break#readme
211
- [@yozora/tokenizer-definition]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/definition#readme
212
- [@yozora/tokenizer-delete]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/delete#readme
213
- [@yozora/tokenizer-ecma-import]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/ecma-import#readme
214
- [@yozora/tokenizer-emphasis]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/emphasis#readme
215
- [@yozora/tokenizer-fenced-block]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/fenced-block#readme
216
- [@yozora/tokenizer-fenced-code]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/fenced-code#readme
217
- [@yozora/tokenizer-footnote]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/footnote#readme
218
- [@yozora/tokenizer-footnote-definition]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/footnote-definition#readme
219
- [@yozora/tokenizer-footnote-reference]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/footnote-reference#readme
220
- [@yozora/tokenizer-heading]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/heading#readme
221
- [@yozora/tokenizer-html-block]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/html-block#readme
222
- [@yozora/tokenizer-html-inline]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/html-inline#readme
223
- [@yozora/tokenizer-image]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/image#readme
224
- [@yozora/tokenizer-image-reference]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/image-reference#readme
225
- [@yozora/tokenizer-indented-code]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/indented-code#readme
226
- [@yozora/tokenizer-inline-code]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/inline-code#readme
227
- [@yozora/tokenizer-inline-math]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/inline-math#readme
228
- [@yozora/tokenizer-link]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/link#readme
229
- [@yozora/tokenizer-link-reference]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/link-reference#readme
230
- [@yozora/tokenizer-list]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/list#readme
231
- [@yozora/tokenizer-math]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/math#readme
232
- [@yozora/tokenizer-paragraph]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/paragraph#readme
233
- [@yozora/tokenizer-setext-heading]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/setext-heading#readme
234
- [@yozora/tokenizer-table]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/table#readme
235
- [@yozora/tokenizer-text]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/text#readme
236
- [@yozora/tokenizer-thematic-break]: https://github.com/yozorajs/yozora/tree/release-2.x.x/tokenizers/thematic-break#readme
206
+ [@yozora/tokenizer-admonition]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/admonition#readme
207
+ [@yozora/tokenizer-autolink]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/autolink#readme
208
+ [@yozora/tokenizer-autolink-extension]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/autolink-extension#readme
209
+ [@yozora/tokenizer-blockquote]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/blockquote#readme
210
+ [@yozora/tokenizer-break]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/break#readme
211
+ [@yozora/tokenizer-definition]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/definition#readme
212
+ [@yozora/tokenizer-delete]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/delete#readme
213
+ [@yozora/tokenizer-ecma-import]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/ecma-import#readme
214
+ [@yozora/tokenizer-emphasis]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/emphasis#readme
215
+ [@yozora/tokenizer-fenced-block]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/fenced-block#readme
216
+ [@yozora/tokenizer-fenced-code]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/fenced-code#readme
217
+ [@yozora/tokenizer-footnote]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/footnote#readme
218
+ [@yozora/tokenizer-footnote-definition]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/footnote-definition#readme
219
+ [@yozora/tokenizer-footnote-reference]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/footnote-reference#readme
220
+ [@yozora/tokenizer-heading]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/heading#readme
221
+ [@yozora/tokenizer-html-block]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/html-block#readme
222
+ [@yozora/tokenizer-html-inline]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/html-inline#readme
223
+ [@yozora/tokenizer-image]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/image#readme
224
+ [@yozora/tokenizer-image-reference]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/image-reference#readme
225
+ [@yozora/tokenizer-indented-code]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/indented-code#readme
226
+ [@yozora/tokenizer-inline-code]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/inline-code#readme
227
+ [@yozora/tokenizer-inline-math]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/inline-math#readme
228
+ [@yozora/tokenizer-link]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/link#readme
229
+ [@yozora/tokenizer-link-reference]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/link-reference#readme
230
+ [@yozora/tokenizer-list]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/list#readme
231
+ [@yozora/tokenizer-math]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/math#readme
232
+ [@yozora/tokenizer-paragraph]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/paragraph#readme
233
+ [@yozora/tokenizer-setext-heading]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/setext-heading#readme
234
+ [@yozora/tokenizer-table]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/table#readme
235
+ [@yozora/tokenizer-text]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/text#readme
236
+ [@yozora/tokenizer-thematic-break]: https://github.com/yozorajs/yozora/tree/v2.1.5/tokenizers/thematic-break#readme
237
237
 
238
238
  [@yozora/react-admonition]: https://github.com/yozorajs/yozora-react/tree/main/packages/admonition#readme
239
239
  [@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-inline-math",
3
- "version": "2.1.3",
3
+ "version": "2.1.5",
4
4
  "description": "Tokenizer for processing inline math (formulas)",
5
5
  "author": {
6
6
  "name": "guanghechen",
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "files": [
39
39
  "lib/",
40
- "src/",
40
+ "!lib/**/*.map",
41
41
  "package.json",
42
42
  "CHANGELOG.md",
43
43
  "LICENSE",
@@ -49,12 +49,12 @@
49
49
  "test": "cross-env TS_NODE_FILES=true NODE_OPTIONS=--experimental-vm-modules jest --config ../../jest.config.mjs --rootDir ."
50
50
  },
51
51
  "dependencies": {
52
- "@yozora/ast": "^2.1.3",
53
- "@yozora/character": "^2.1.3",
54
- "@yozora/core-tokenizer": "^2.1.3"
52
+ "@yozora/ast": "^2.1.5",
53
+ "@yozora/character": "^2.1.5",
54
+ "@yozora/core-tokenizer": "^2.1.5"
55
55
  },
56
56
  "devDependencies": {
57
- "@yozora/tokenizer-inline-code": "^2.1.3"
57
+ "@yozora/tokenizer-inline-code": "^2.1.5"
58
58
  },
59
- "gitHead": "9abaaff74a12d0bae0f645813241ff947a0d828c"
59
+ "gitHead": "4f753bcf0fd921938464802462dc48c53bbd014d"
60
60
  }
package/src/index.ts DELETED
@@ -1,9 +0,0 @@
1
- export { match as inlineMathMatch } from './match'
2
- export { parse as inlineMathParse } from './parse'
3
- export { InlineMathTokenizer, InlineMathTokenizer as default } from './tokenizer'
4
- export { uniqueName as InlineMathTokenizerName } from './types'
5
- export type {
6
- IThis as IInlineMathHookContext,
7
- IToken as IInlineMathToken,
8
- ITokenizerProps as IInlineMathTokenizerProps,
9
- } from './types'
package/src/match.ts DELETED
@@ -1,172 +0,0 @@
1
- import { InlineMathType } from '@yozora/ast'
2
- import type { INodeInterval, INodePoint } from '@yozora/character'
3
- import { AsciiCodePoint } from '@yozora/character'
4
- import type {
5
- IMatchInlineHookCreator,
6
- IResultOfFindDelimiters,
7
- IResultOfProcessSingleDelimiter,
8
- ITokenDelimiter,
9
- } from '@yozora/core-tokenizer'
10
- import { eatOptionalCharacters } from '@yozora/core-tokenizer'
11
- import type { IDelimiter, IThis, IToken, T } from './types'
12
-
13
- export const match: IMatchInlineHookCreator<T, IDelimiter, IToken, IThis> = function (api) {
14
- const { backtickRequired } = this
15
- return { findDelimiter, processSingleDelimiter }
16
-
17
- function* findDelimiter(): IResultOfFindDelimiters<IDelimiter> {
18
- const nodePoints: ReadonlyArray<INodePoint> = api.getNodePoints()
19
- const blockStartIndex: number = api.getBlockStartIndex()
20
- const blockEndIndex: number = api.getBlockEndIndex()
21
-
22
- const potentialDelimiters: ITokenDelimiter[] = []
23
- for (let i = blockStartIndex; i < blockEndIndex; ++i) {
24
- const c = nodePoints[i].codePoint
25
- switch (c) {
26
- case AsciiCodePoint.BACKSLASH:
27
- /**
28
- * Note that unlink code spans, backslash escapes works in inline-math.
29
- * @see https://github.github.com/gfm/#example-348
30
- */
31
- i += 1
32
- break
33
- /**
34
- * A backtick string is a string of one or more backtick characters '`'
35
- * that is neither preceded nor followed by a backtick.
36
- * A code span begins with a backtick string and ends with a
37
- * backtick string of equal length.
38
- * @see https://github.github.com/gfm/#backtick-string
39
- * @see https://github.github.com/gfm/#code-span
40
- *
41
- * the left flanking string pattern is: <BACKTICK STRING><DOLLAR_SIGN>.
42
- * eg: `$, ``$
43
- *
44
- * A backtick string is a string of one or more backtick
45
- * characters '`' that is neither preceded nor followed by a backtick.
46
- * @see https://github.github.com/gfm/#backtick-string
47
- */
48
- case AsciiCodePoint.BACKTICK: {
49
- const _startIndex = i
50
-
51
- // matched as many backtick as possible
52
- i = eatOptionalCharacters(nodePoints, i + 1, blockEndIndex, AsciiCodePoint.BACKTICK)
53
-
54
- // No dollar character found after backtick string
55
- if (i >= blockEndIndex || nodePoints[i].codePoint !== AsciiCodePoint.DOLLAR_SIGN) {
56
- break
57
- }
58
-
59
- const delimiter: ITokenDelimiter = {
60
- type: 'opener',
61
- startIndex: _startIndex,
62
- endIndex: i + 1,
63
- }
64
- potentialDelimiters.push(delimiter)
65
- break
66
- }
67
- /**
68
- * the right flanking string pattern is: <DOLLAR_SIGN><BACKTICK STRING>.
69
- * eg: $`, $``
70
- *
71
- * A backtick string is a string of one or more backtick characters '`'
72
- * that is neither preceded nor followed by a backtick.
73
- * @see https://github.github.com/gfm/#backtick-string
74
- */
75
- case AsciiCodePoint.DOLLAR_SIGN: {
76
- // matched as many backtick as possible
77
- const _startIndex = i
78
- i = eatOptionalCharacters(nodePoints, i + 1, blockEndIndex, AsciiCodePoint.BACKTICK)
79
-
80
- // A dollar sign followed by a dollar sign is not part of a valid
81
- // inlineMath delimiter
82
- if (i < blockEndIndex && nodePoints[i].codePoint === AsciiCodePoint.DOLLAR_SIGN) {
83
- break
84
- }
85
-
86
- const thickness: number = i - _startIndex
87
-
88
- // No backtick character found after dollar
89
- if (thickness <= 1) {
90
- if (backtickRequired) break
91
- const delimiter: ITokenDelimiter = {
92
- type: 'both',
93
- startIndex: _startIndex,
94
- endIndex: i,
95
- }
96
- potentialDelimiters.push(delimiter)
97
- break
98
- }
99
-
100
- const delimiter: ITokenDelimiter = {
101
- type: 'closer',
102
- startIndex: _startIndex,
103
- endIndex: i,
104
- }
105
- potentialDelimiters.push(delimiter)
106
- i -= 1
107
- break
108
- }
109
- }
110
- }
111
-
112
- let pIndex = 0
113
- let lastEndIndex = -1
114
- let delimiter: IDelimiter | null = null
115
- while (pIndex < potentialDelimiters.length) {
116
- const [startIndex, endIndex] = yield delimiter
117
-
118
- // Read from cache.
119
- if (lastEndIndex === endIndex) {
120
- if (delimiter == null || delimiter.startIndex >= startIndex) continue
121
- }
122
- lastEndIndex = endIndex
123
-
124
- let openerDelimiter: INodeInterval | null = null
125
- let closerDelimiter: INodeInterval | null = null
126
- for (; pIndex < potentialDelimiters.length; ++pIndex) {
127
- for (; pIndex < potentialDelimiters.length; ++pIndex) {
128
- const delimiter = potentialDelimiters[pIndex]
129
- if (delimiter.startIndex >= startIndex && delimiter.type !== 'closer') break
130
- }
131
- if (pIndex + 1 >= potentialDelimiters.length) break
132
-
133
- openerDelimiter = potentialDelimiters[pIndex]
134
- const thickness = openerDelimiter.endIndex - openerDelimiter.startIndex
135
- for (let i = pIndex + 1; i < potentialDelimiters.length; ++i) {
136
- const delimiter = potentialDelimiters[i]
137
- if (
138
- delimiter.type !== 'opener' &&
139
- delimiter.endIndex - delimiter.startIndex === thickness
140
- ) {
141
- closerDelimiter = delimiter
142
- break
143
- }
144
- }
145
-
146
- // No matched inlineCode closer marker found, try next one.
147
- if (closerDelimiter != null) break
148
- }
149
-
150
- if (closerDelimiter == null) return
151
-
152
- delimiter = {
153
- type: 'full',
154
- startIndex: openerDelimiter!.startIndex,
155
- endIndex: closerDelimiter.endIndex,
156
- thickness: closerDelimiter.endIndex - closerDelimiter.startIndex,
157
- }
158
- }
159
- }
160
-
161
- function processSingleDelimiter(
162
- delimiter: IDelimiter,
163
- ): IResultOfProcessSingleDelimiter<T, IToken> {
164
- const token: IToken = {
165
- nodeType: InlineMathType,
166
- startIndex: delimiter.startIndex,
167
- endIndex: delimiter.endIndex,
168
- thickness: delimiter.thickness,
169
- }
170
- return [token]
171
- }
172
- }
package/src/parse.ts DELETED
@@ -1,53 +0,0 @@
1
- import { InlineMathType } from '@yozora/ast'
2
- import type { INodePoint } from '@yozora/character'
3
- import { calcStringFromNodePoints, isSpaceLike } from '@yozora/character'
4
- import type { IParseInlineHookCreator } from '@yozora/core-tokenizer'
5
- import type { INode, IThis, IToken, T } from './types'
6
-
7
- export const parse: IParseInlineHookCreator<T, IToken, INode, IThis> = function (api) {
8
- return {
9
- parse: tokens =>
10
- tokens.map(token => {
11
- const nodePoints: ReadonlyArray<INodePoint> = api.getNodePoints()
12
- let startIndex: number = token.startIndex + token.thickness
13
- let endIndex: number = token.endIndex - token.thickness
14
-
15
- let isAllSpace = true
16
- for (let i = startIndex; i < endIndex; ++i) {
17
- if (isSpaceLike(nodePoints[i].codePoint)) continue
18
- isAllSpace = false
19
- break
20
- }
21
-
22
- /**
23
- * If the resulting string both begins and ends with a space character,
24
- * but doesn't consist entirely of space characters, a single space
25
- * character is removed from the front and back. This allows you to
26
- * include code that begins or endsWith backtick characters, which must
27
- * be separated by whitespace from the opening or closing backtick strings.
28
- * @see https://github.github.com/gfm/#example-340
29
- *
30
- * Only spaces, and not unicode whitespace in general, are stripped
31
- * in this way
32
- * @see https://github.github.com/gfm/#example-343
33
- *
34
- * No stripping occurs if the code span contains only spaces
35
- * @see https://github.github.com/gfm/#example-344
36
- */
37
- if (!isAllSpace && startIndex + 2 < endIndex) {
38
- const firstCharacter = nodePoints[startIndex].codePoint
39
- const lastCharacter = nodePoints[endIndex - 1].codePoint
40
- if (isSpaceLike(firstCharacter) && isSpaceLike(lastCharacter)) {
41
- startIndex += 1
42
- endIndex -= 1
43
- }
44
- }
45
-
46
- const value = calcStringFromNodePoints(nodePoints, startIndex, endIndex).replace(/\n/g, ' ')
47
- const node: INode = api.shouldReservePosition
48
- ? { type: InlineMathType, position: api.calcPosition(token), value }
49
- : { type: InlineMathType, value }
50
- return node
51
- }),
52
- }
53
- }
package/src/tokenizer.ts DELETED
@@ -1,33 +0,0 @@
1
- import type {
2
- IInlineTokenizer,
3
- IMatchInlineHookCreator,
4
- IParseInlineHookCreator,
5
- } from '@yozora/core-tokenizer'
6
- import { BaseInlineTokenizer, TokenizerPriority } from '@yozora/core-tokenizer'
7
- import { match } from './match'
8
- import { parse } from './parse'
9
- import type { IDelimiter, INode, IThis, IToken, ITokenizerProps, T } from './types'
10
- import { uniqueName } from './types'
11
-
12
- /**
13
- * Lexical Analyzer for inlineMath.
14
- */
15
- export class InlineMathTokenizer
16
- extends BaseInlineTokenizer<T, IDelimiter, IToken, INode, IThis>
17
- implements IInlineTokenizer<T, IDelimiter, IToken, INode, IThis>
18
- {
19
- public readonly backtickRequired: boolean
20
-
21
- /* istanbul ignore next */
22
- constructor(props: ITokenizerProps = {}) {
23
- super({
24
- name: props.name ?? uniqueName,
25
- priority: props.priority ?? TokenizerPriority.ATOMIC,
26
- })
27
- this.backtickRequired = props.backtickRequired ?? true
28
- }
29
-
30
- public override readonly match: IMatchInlineHookCreator<T, IDelimiter, IToken, IThis> = match
31
-
32
- public override readonly parse: IParseInlineHookCreator<T, IToken, INode, IThis> = parse
33
- }
package/src/types.ts DELETED
@@ -1,44 +0,0 @@
1
- import type { InlineMath, InlineMathType } from '@yozora/ast'
2
- import type {
3
- IBaseInlineTokenizerProps,
4
- IPartialInlineToken,
5
- ITokenDelimiter,
6
- ITokenizer,
7
- } from '@yozora/core-tokenizer'
8
-
9
- export type T = InlineMathType
10
- export type INode = InlineMath
11
- export const uniqueName = '@yozora/tokenizer-inline-math'
12
-
13
- export interface IToken extends IPartialInlineToken<T> {
14
- /**
15
- * Thickness of the InlineMathDelimiter
16
- */
17
- thickness: number
18
- }
19
-
20
- /**
21
- * IDelimiter of InlineMathToken.
22
- */
23
- export interface IDelimiter extends ITokenDelimiter {
24
- type: 'full'
25
- /**
26
- * Thickness of the InlineMathDelimiter
27
- */
28
- thickness: number
29
- }
30
-
31
- export interface IThis extends ITokenizer {
32
- /**
33
- * Whether if the backtick mark wrapping necessary.
34
- */
35
- readonly backtickRequired: boolean
36
- }
37
-
38
- export interface ITokenizerProps extends Partial<IBaseInlineTokenizerProps> {
39
- /**
40
- * Whether if the backtick mark wrapping necessary.
41
- * @default true
42
- */
43
- readonly backtickRequired?: boolean
44
- }