gitlab-glfm-markdown 0.0.7-arm64-darwin → 0.0.8-arm64-darwin

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c5cf1bc09011345a82a6c8c0f6e6cae7cda5e4830d3d47389037299ad33d56fc
4
- data.tar.gz: f275ec696bc3fd8c96bd03f9ed040b8c3d4ebe195315270ea78bb7448e7afecf
3
+ metadata.gz: 9cd18235a8d558fca7e0190982a7f639b577195eb83b376695367ad10252ede1
4
+ data.tar.gz: a0f6e948e8b252532222c335fd9fb21bfc6ffcdcf5f227cedee2223294749b3a
5
5
  SHA512:
6
- metadata.gz: 7158a62aff146dcb82b047433d88be66c2110c122a313148d13955972b22d65da9aba46e134d4f8e1d537ea7bc65046e20a7859f74a67fce88e1fda418e968e4
7
- data.tar.gz: ba5d7a746555970074457dfc5955f953db1e3f1d6c3767a9f616f54e6a91e5fafd112e41b13c60b26e2b697b11c3281804290d83331ab0fda2ece20bb2a483ad
6
+ metadata.gz: 0c3989a5db75153884991792633cca544a263fbe1e5decc6444abbc25209648a12501da39cb15333c4aa7ad0c8005d6442ea58bafed518e8e36b19d9185e5a97
7
+ data.tar.gz: 57ba4f9cc8d4ec244a521c5edb77c208a7172801a01ec6141fdf907943bb05f92242e3b47cb758d964a07bddf6fbd9bb2e8375e842728a4b448511c0abf6969c
data/Cargo.lock CHANGED
@@ -19,29 +19,14 @@ dependencies = [
19
19
 
20
20
  [[package]]
21
21
  name = "anstream"
22
- version = "0.4.0"
22
+ version = "0.6.5"
23
23
  source = "registry+https://github.com/rust-lang/crates.io-index"
24
- checksum = "735917dc4838cee6a072ea1fd4b6e4e6ff00cbe95c7875967482961c36a0b68f"
24
+ checksum = "d664a92ecae85fd0a7392615844904654d1d5f5514837f471ddef4a057aba1b6"
25
25
  dependencies = [
26
26
  "anstyle",
27
27
  "anstyle-parse",
28
28
  "anstyle-query",
29
- "anstyle-wincon 2.1.0",
30
- "colorchoice",
31
- "is-terminal",
32
- "utf8parse",
33
- ]
34
-
35
- [[package]]
36
- name = "anstream"
37
- version = "0.6.4"
38
- source = "registry+https://github.com/rust-lang/crates.io-index"
39
- checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44"
40
- dependencies = [
41
- "anstyle",
42
- "anstyle-parse",
43
- "anstyle-query",
44
- "anstyle-wincon 3.0.1",
29
+ "anstyle-wincon",
45
30
  "colorchoice",
46
31
  "utf8parse",
47
32
  ]
@@ -54,59 +39,37 @@ checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87"
54
39
 
55
40
  [[package]]
56
41
  name = "anstyle-parse"
57
- version = "0.2.2"
42
+ version = "0.2.3"
58
43
  source = "registry+https://github.com/rust-lang/crates.io-index"
59
- checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140"
44
+ checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c"
60
45
  dependencies = [
61
46
  "utf8parse",
62
47
  ]
63
48
 
64
49
  [[package]]
65
50
  name = "anstyle-query"
66
- version = "1.0.0"
67
- source = "registry+https://github.com/rust-lang/crates.io-index"
68
- checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b"
69
- dependencies = [
70
- "windows-sys",
71
- ]
72
-
73
- [[package]]
74
- name = "anstyle-wincon"
75
- version = "2.1.0"
51
+ version = "1.0.2"
76
52
  source = "registry+https://github.com/rust-lang/crates.io-index"
77
- checksum = "58f54d10c6dfa51283a066ceab3ec1ab78d13fae00aa49243a45e4571fb79dfd"
53
+ checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648"
78
54
  dependencies = [
79
- "anstyle",
80
55
  "windows-sys",
81
56
  ]
82
57
 
83
58
  [[package]]
84
59
  name = "anstyle-wincon"
85
- version = "3.0.1"
60
+ version = "3.0.2"
86
61
  source = "registry+https://github.com/rust-lang/crates.io-index"
87
- checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628"
62
+ checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7"
88
63
  dependencies = [
89
64
  "anstyle",
90
65
  "windows-sys",
91
66
  ]
92
67
 
93
- [[package]]
94
- name = "argparse"
95
- version = "0.2.2"
96
- source = "registry+https://github.com/rust-lang/crates.io-index"
97
- checksum = "3f8ebf5827e4ac4fd5946560e6a99776ea73b596d80898f357007317a7141e47"
98
-
99
- [[package]]
100
- name = "autocfg"
101
- version = "1.1.0"
102
- source = "registry+https://github.com/rust-lang/crates.io-index"
103
- checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
104
-
105
68
  [[package]]
106
69
  name = "base64"
107
- version = "0.21.4"
70
+ version = "0.21.5"
108
71
  source = "registry+https://github.com/rust-lang/crates.io-index"
109
- checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2"
72
+ checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9"
110
73
 
111
74
  [[package]]
112
75
  name = "bincode"
@@ -119,11 +82,11 @@ dependencies = [
119
82
 
120
83
  [[package]]
121
84
  name = "bindgen"
122
- version = "0.66.1"
85
+ version = "0.69.1"
123
86
  source = "registry+https://github.com/rust-lang/crates.io-index"
124
- checksum = "f2b84e06fc203107bfbad243f4aba2af864eb7db3b1cf46ea0a023b0b433d2a7"
87
+ checksum = "9ffcebc3849946a7170a05992aac39da343a90676ab392c51a4280981d6379c2"
125
88
  dependencies = [
126
- "bitflags 2.4.0",
89
+ "bitflags 2.4.1",
127
90
  "cexpr",
128
91
  "clang-sys",
129
92
  "lazy_static",
@@ -134,7 +97,7 @@ dependencies = [
134
97
  "regex",
135
98
  "rustc-hash",
136
99
  "shlex",
137
- "syn 2.0.38",
100
+ "syn 2.0.41",
138
101
  ]
139
102
 
140
103
  [[package]]
@@ -160,9 +123,15 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
160
123
 
161
124
  [[package]]
162
125
  name = "bitflags"
163
- version = "2.4.0"
126
+ version = "2.4.1"
164
127
  source = "registry+https://github.com/rust-lang/crates.io-index"
165
- checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635"
128
+ checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07"
129
+
130
+ [[package]]
131
+ name = "bumpalo"
132
+ version = "3.14.0"
133
+ source = "registry+https://github.com/rust-lang/crates.io-index"
134
+ checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec"
166
135
 
167
136
  [[package]]
168
137
  name = "cc"
@@ -201,9 +170,9 @@ dependencies = [
201
170
 
202
171
  [[package]]
203
172
  name = "clap"
204
- version = "4.4.6"
173
+ version = "4.4.11"
205
174
  source = "registry+https://github.com/rust-lang/crates.io-index"
206
- checksum = "d04704f56c2cde07f43e8e2c154b43f216dc5c92fc98ada720177362f953b956"
175
+ checksum = "bfaff671f6b22ca62406885ece523383b9b64022e341e53e009a62ebc47a45f2"
207
176
  dependencies = [
208
177
  "clap_builder",
209
178
  "clap_derive",
@@ -211,34 +180,33 @@ dependencies = [
211
180
 
212
181
  [[package]]
213
182
  name = "clap_builder"
214
- version = "4.4.6"
183
+ version = "4.4.11"
215
184
  source = "registry+https://github.com/rust-lang/crates.io-index"
216
- checksum = "0e231faeaca65ebd1ea3c737966bf858971cd38c3849107aa3ea7de90a804e45"
185
+ checksum = "a216b506622bb1d316cd51328dce24e07bdff4a6128a47c7e7fad11878d5adbb"
217
186
  dependencies = [
218
- "anstream 0.6.4",
187
+ "anstream",
219
188
  "anstyle",
220
189
  "clap_lex",
221
190
  "strsim",
222
- "terminal_size",
223
191
  ]
224
192
 
225
193
  [[package]]
226
194
  name = "clap_derive"
227
- version = "4.4.2"
195
+ version = "4.4.7"
228
196
  source = "registry+https://github.com/rust-lang/crates.io-index"
229
- checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873"
197
+ checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442"
230
198
  dependencies = [
231
199
  "heck",
232
200
  "proc-macro2",
233
201
  "quote",
234
- "syn 2.0.38",
202
+ "syn 2.0.41",
235
203
  ]
236
204
 
237
205
  [[package]]
238
206
  name = "clap_lex"
239
- version = "0.5.1"
207
+ version = "0.6.0"
240
208
  source = "registry+https://github.com/rust-lang/crates.io-index"
241
- checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961"
209
+ checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1"
242
210
 
243
211
  [[package]]
244
212
  name = "colorchoice"
@@ -248,22 +216,19 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7"
248
216
 
249
217
  [[package]]
250
218
  name = "comrak"
251
- version = "0.19.0"
219
+ version = "0.20.0"
252
220
  source = "registry+https://github.com/rust-lang/crates.io-index"
253
- checksum = "82c995deda3bfdebd07d0e2af79e9da13e4b1be652b21a746f3f5b24bf0a49ef"
221
+ checksum = "9f18e72341e6cdc7489cffb76f993812a14a906db54dedb020044ccc211dcaae"
254
222
  dependencies = [
255
- "clap",
256
223
  "derive_builder",
257
224
  "entities",
258
225
  "memchr",
259
226
  "once_cell",
260
227
  "regex",
261
- "shell-words",
262
228
  "slug",
263
229
  "syntect",
264
230
  "typed-arena",
265
231
  "unicode_categories",
266
- "xdg",
267
232
  ]
268
233
 
269
234
  [[package]]
@@ -312,9 +277,12 @@ dependencies = [
312
277
 
313
278
  [[package]]
314
279
  name = "deranged"
315
- version = "0.3.8"
280
+ version = "0.3.10"
316
281
  source = "registry+https://github.com/rust-lang/crates.io-index"
317
- checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946"
282
+ checksum = "8eb30d70a07a3b04884d2677f06bec33509dc67ca60d92949e5535352d3191dc"
283
+ dependencies = [
284
+ "powerfmt",
285
+ ]
318
286
 
319
287
  [[package]]
320
288
  name = "derive_builder"
@@ -349,9 +317,9 @@ dependencies = [
349
317
 
350
318
  [[package]]
351
319
  name = "deunicode"
352
- version = "0.4.4"
320
+ version = "1.4.2"
353
321
  source = "registry+https://github.com/rust-lang/crates.io-index"
354
- checksum = "d95203a6a50906215a502507c0f879a0ce7ff205a6111e2db2a5ef8e4bb92e43"
322
+ checksum = "3ae2a35373c5c74340b79ae6780b498b2b183915ec5dacf263aac5a099bf485a"
355
323
 
356
324
  [[package]]
357
325
  name = "entities"
@@ -360,14 +328,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
360
328
  checksum = "b5320ae4c3782150d900b79807611a59a99fc9a1d61d686faafc24b93fc8d7ca"
361
329
 
362
330
  [[package]]
363
- name = "errno"
364
- version = "0.3.5"
331
+ name = "equivalent"
332
+ version = "1.0.1"
365
333
  source = "registry+https://github.com/rust-lang/crates.io-index"
366
- checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860"
367
- dependencies = [
368
- "libc",
369
- "windows-sys",
370
- ]
334
+ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
371
335
 
372
336
  [[package]]
373
337
  name = "fancy-regex"
@@ -381,9 +345,9 @@ dependencies = [
381
345
 
382
346
  [[package]]
383
347
  name = "flate2"
384
- version = "1.0.27"
348
+ version = "1.0.28"
385
349
  source = "registry+https://github.com/rust-lang/crates.io-index"
386
- checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010"
350
+ checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e"
387
351
  dependencies = [
388
352
  "crc32fast",
389
353
  "miniz_oxide",
@@ -397,10 +361,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
397
361
 
398
362
  [[package]]
399
363
  name = "glfm_markdown"
400
- version = "0.0.3"
364
+ version = "0.0.8"
401
365
  dependencies = [
402
- "anstream 0.4.0",
403
- "argparse",
366
+ "clap",
404
367
  "comrak",
405
368
  "magnus",
406
369
  "rb-sys",
@@ -414,9 +377,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
414
377
 
415
378
  [[package]]
416
379
  name = "hashbrown"
417
- version = "0.12.3"
380
+ version = "0.14.3"
418
381
  source = "registry+https://github.com/rust-lang/crates.io-index"
419
- checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
382
+ checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604"
420
383
 
421
384
  [[package]]
422
385
  name = "heck"
@@ -424,12 +387,6 @@ version = "0.4.1"
424
387
  source = "registry+https://github.com/rust-lang/crates.io-index"
425
388
  checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
426
389
 
427
- [[package]]
428
- name = "hermit-abi"
429
- version = "0.3.3"
430
- source = "registry+https://github.com/rust-lang/crates.io-index"
431
- checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7"
432
-
433
390
  [[package]]
434
391
  name = "ident_case"
435
392
  version = "1.0.1"
@@ -438,30 +395,19 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
438
395
 
439
396
  [[package]]
440
397
  name = "indexmap"
441
- version = "1.9.3"
398
+ version = "2.1.0"
442
399
  source = "registry+https://github.com/rust-lang/crates.io-index"
443
- checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99"
400
+ checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f"
444
401
  dependencies = [
445
- "autocfg",
402
+ "equivalent",
446
403
  "hashbrown",
447
404
  ]
448
405
 
449
- [[package]]
450
- name = "is-terminal"
451
- version = "0.4.9"
452
- source = "registry+https://github.com/rust-lang/crates.io-index"
453
- checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b"
454
- dependencies = [
455
- "hermit-abi",
456
- "rustix",
457
- "windows-sys",
458
- ]
459
-
460
406
  [[package]]
461
407
  name = "itoa"
462
- version = "1.0.9"
408
+ version = "1.0.10"
463
409
  source = "registry+https://github.com/rust-lang/crates.io-index"
464
- checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38"
410
+ checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c"
465
411
 
466
412
  [[package]]
467
413
  name = "lazy_static"
@@ -477,9 +423,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
477
423
 
478
424
  [[package]]
479
425
  name = "libc"
480
- version = "0.2.149"
426
+ version = "0.2.151"
481
427
  source = "registry+https://github.com/rust-lang/crates.io-index"
482
- checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b"
428
+ checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4"
483
429
 
484
430
  [[package]]
485
431
  name = "libloading"
@@ -507,31 +453,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
507
453
  checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f"
508
454
 
509
455
  [[package]]
510
- name = "linux-raw-sys"
511
- version = "0.4.10"
456
+ name = "log"
457
+ version = "0.4.20"
512
458
  source = "registry+https://github.com/rust-lang/crates.io-index"
513
- checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f"
459
+ checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f"
514
460
 
515
461
  [[package]]
516
462
  name = "magnus"
517
- version = "0.5.5"
463
+ version = "0.6.2"
518
464
  source = "registry+https://github.com/rust-lang/crates.io-index"
519
- checksum = "5b7a37670bc433d081ef5846d5589381fabd8d3410ad3b59faa6b1b4c9c3cbce"
465
+ checksum = "4778544796676e8428e9c622460ebf284bea52d8b10db3aeb449d8b5e61b3a13"
520
466
  dependencies = [
521
467
  "magnus-macros",
522
468
  "rb-sys",
523
469
  "rb-sys-env",
470
+ "seq-macro",
524
471
  ]
525
472
 
526
473
  [[package]]
527
474
  name = "magnus-macros"
528
- version = "0.4.1"
475
+ version = "0.6.0"
529
476
  source = "registry+https://github.com/rust-lang/crates.io-index"
530
- checksum = "6cc17af1d45442c011aa579d727ec6cff8a69aea8a6bbad26736e7112d749bfb"
477
+ checksum = "5968c820e2960565f647819f5928a42d6e874551cab9d88d75e3e0660d7f71e3"
531
478
  dependencies = [
532
479
  "proc-macro2",
533
480
  "quote",
534
- "syn 1.0.109",
481
+ "syn 2.0.41",
535
482
  ]
536
483
 
537
484
  [[package]]
@@ -567,9 +514,9 @@ dependencies = [
567
514
 
568
515
  [[package]]
569
516
  name = "once_cell"
570
- version = "1.18.0"
517
+ version = "1.19.0"
571
518
  source = "registry+https://github.com/rust-lang/crates.io-index"
572
- checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"
519
+ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
573
520
 
574
521
  [[package]]
575
522
  name = "onig"
@@ -607,9 +554,9 @@ checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964"
607
554
 
608
555
  [[package]]
609
556
  name = "plist"
610
- version = "1.5.0"
557
+ version = "1.6.0"
611
558
  source = "registry+https://github.com/rust-lang/crates.io-index"
612
- checksum = "bdc0001cfea3db57a2e24bc0d818e9e20e554b5f97fabb9bc231dc240269ae06"
559
+ checksum = "e5699cc8a63d1aa2b1ee8e12b9ad70ac790d65788cd36101fa37f87ea46c4cef"
613
560
  dependencies = [
614
561
  "base64",
615
562
  "indexmap",
@@ -619,20 +566,26 @@ dependencies = [
619
566
  "time",
620
567
  ]
621
568
 
569
+ [[package]]
570
+ name = "powerfmt"
571
+ version = "0.2.0"
572
+ source = "registry+https://github.com/rust-lang/crates.io-index"
573
+ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
574
+
622
575
  [[package]]
623
576
  name = "proc-macro2"
624
- version = "1.0.69"
577
+ version = "1.0.70"
625
578
  source = "registry+https://github.com/rust-lang/crates.io-index"
626
- checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da"
579
+ checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b"
627
580
  dependencies = [
628
581
  "unicode-ident",
629
582
  ]
630
583
 
631
584
  [[package]]
632
585
  name = "quick-xml"
633
- version = "0.29.0"
586
+ version = "0.31.0"
634
587
  source = "registry+https://github.com/rust-lang/crates.io-index"
635
- checksum = "81b9228215d82c7b61490fec1de287136b5de6f5700f6e58ea9ad61a7964ca51"
588
+ checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33"
636
589
  dependencies = [
637
590
  "memchr",
638
591
  ]
@@ -648,18 +601,18 @@ dependencies = [
648
601
 
649
602
  [[package]]
650
603
  name = "rb-sys"
651
- version = "0.9.82"
604
+ version = "0.9.84"
652
605
  source = "registry+https://github.com/rust-lang/crates.io-index"
653
- checksum = "a3e6bf79bf4c711917cacfaf46dfab4314dbfdd89a8ee3ec4b98336cd23f1ebf"
606
+ checksum = "3def04a96a36ef8681a2b2e26c01683b93a8630175c845fa06cab76c5a8c7ce0"
654
607
  dependencies = [
655
608
  "rb-sys-build",
656
609
  ]
657
610
 
658
611
  [[package]]
659
612
  name = "rb-sys-build"
660
- version = "0.9.82"
613
+ version = "0.9.84"
661
614
  source = "registry+https://github.com/rust-lang/crates.io-index"
662
- checksum = "5482a1ed4cde58dddaf162b6aebcb5c25645822547832b8be101f2acd40bcdd6"
615
+ checksum = "c017d134afd764dd43c2faa91aa50b698a3bb4ff30e83113da483c789e74be8c"
663
616
  dependencies = [
664
617
  "bindgen",
665
618
  "lazy_static",
@@ -667,7 +620,7 @@ dependencies = [
667
620
  "quote",
668
621
  "regex",
669
622
  "shell-words",
670
- "syn 2.0.38",
623
+ "syn 2.0.41",
671
624
  ]
672
625
 
673
626
  [[package]]
@@ -678,25 +631,25 @@ checksum = "a35802679f07360454b418a5d1735c89716bde01d35b1560fc953c1415a0b3bb"
678
631
 
679
632
  [[package]]
680
633
  name = "regex"
681
- version = "1.10.0"
634
+ version = "1.10.2"
682
635
  source = "registry+https://github.com/rust-lang/crates.io-index"
683
- checksum = "d119d7c7ca818f8a53c300863d4f87566aac09943aef5b355bb83969dae75d87"
636
+ checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343"
684
637
  dependencies = [
685
638
  "aho-corasick",
686
639
  "memchr",
687
640
  "regex-automata",
688
- "regex-syntax 0.8.1",
641
+ "regex-syntax 0.8.2",
689
642
  ]
690
643
 
691
644
  [[package]]
692
645
  name = "regex-automata"
693
- version = "0.4.1"
646
+ version = "0.4.3"
694
647
  source = "registry+https://github.com/rust-lang/crates.io-index"
695
- checksum = "465c6fc0621e4abc4187a2bda0937bfd4f722c2730b29562e19689ea796c9a4b"
648
+ checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f"
696
649
  dependencies = [
697
650
  "aho-corasick",
698
651
  "memchr",
699
- "regex-syntax 0.8.1",
652
+ "regex-syntax 0.8.2",
700
653
  ]
701
654
 
702
655
  [[package]]
@@ -707,9 +660,9 @@ checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da"
707
660
 
708
661
  [[package]]
709
662
  name = "regex-syntax"
710
- version = "0.8.1"
663
+ version = "0.8.2"
711
664
  source = "registry+https://github.com/rust-lang/crates.io-index"
712
- checksum = "56d84fdd47036b038fc80dd333d10b6aab10d5d31f4a366e20014def75328d33"
665
+ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
713
666
 
714
667
  [[package]]
715
668
  name = "rustc-hash"
@@ -717,24 +670,11 @@ version = "1.1.0"
717
670
  source = "registry+https://github.com/rust-lang/crates.io-index"
718
671
  checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
719
672
 
720
- [[package]]
721
- name = "rustix"
722
- version = "0.38.18"
723
- source = "registry+https://github.com/rust-lang/crates.io-index"
724
- checksum = "5a74ee2d7c2581cd139b42447d7d9389b889bdaad3a73f1ebb16f2a3237bb19c"
725
- dependencies = [
726
- "bitflags 2.4.0",
727
- "errno",
728
- "libc",
729
- "linux-raw-sys",
730
- "windows-sys",
731
- ]
732
-
733
673
  [[package]]
734
674
  name = "ryu"
735
- version = "1.0.15"
675
+ version = "1.0.16"
736
676
  source = "registry+https://github.com/rust-lang/crates.io-index"
737
- checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741"
677
+ checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c"
738
678
 
739
679
  [[package]]
740
680
  name = "safemem"
@@ -751,31 +691,37 @@ dependencies = [
751
691
  "winapi-util",
752
692
  ]
753
693
 
694
+ [[package]]
695
+ name = "seq-macro"
696
+ version = "0.3.5"
697
+ source = "registry+https://github.com/rust-lang/crates.io-index"
698
+ checksum = "a3f0bf26fd526d2a95683cd0f87bf103b8539e2ca1ef48ce002d67aad59aa0b4"
699
+
754
700
  [[package]]
755
701
  name = "serde"
756
- version = "1.0.188"
702
+ version = "1.0.193"
757
703
  source = "registry+https://github.com/rust-lang/crates.io-index"
758
- checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e"
704
+ checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89"
759
705
  dependencies = [
760
706
  "serde_derive",
761
707
  ]
762
708
 
763
709
  [[package]]
764
710
  name = "serde_derive"
765
- version = "1.0.188"
711
+ version = "1.0.193"
766
712
  source = "registry+https://github.com/rust-lang/crates.io-index"
767
- checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2"
713
+ checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3"
768
714
  dependencies = [
769
715
  "proc-macro2",
770
716
  "quote",
771
- "syn 2.0.38",
717
+ "syn 2.0.41",
772
718
  ]
773
719
 
774
720
  [[package]]
775
721
  name = "serde_json"
776
- version = "1.0.107"
722
+ version = "1.0.108"
777
723
  source = "registry+https://github.com/rust-lang/crates.io-index"
778
- checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65"
724
+ checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b"
779
725
  dependencies = [
780
726
  "itoa",
781
727
  "ryu",
@@ -796,11 +742,12 @@ checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380"
796
742
 
797
743
  [[package]]
798
744
  name = "slug"
799
- version = "0.1.4"
745
+ version = "0.1.5"
800
746
  source = "registry+https://github.com/rust-lang/crates.io-index"
801
- checksum = "b3bc762e6a4b6c6fcaade73e77f9ebc6991b676f88bb2358bddb56560f073373"
747
+ checksum = "3bd94acec9c8da640005f8e135a39fc0372e74535e6b368b7a04b875f784c8c4"
802
748
  dependencies = [
803
749
  "deunicode",
750
+ "wasm-bindgen",
804
751
  ]
805
752
 
806
753
  [[package]]
@@ -822,9 +769,9 @@ dependencies = [
822
769
 
823
770
  [[package]]
824
771
  name = "syn"
825
- version = "2.0.38"
772
+ version = "2.0.41"
826
773
  source = "registry+https://github.com/rust-lang/crates.io-index"
827
- checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b"
774
+ checksum = "44c8b28c477cc3bf0e7966561e3460130e1255f7a1cf71931075f1c5e7a7e269"
828
775
  dependencies = [
829
776
  "proc-macro2",
830
777
  "quote",
@@ -853,44 +800,35 @@ dependencies = [
853
800
  "yaml-rust",
854
801
  ]
855
802
 
856
- [[package]]
857
- name = "terminal_size"
858
- version = "0.3.0"
859
- source = "registry+https://github.com/rust-lang/crates.io-index"
860
- checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7"
861
- dependencies = [
862
- "rustix",
863
- "windows-sys",
864
- ]
865
-
866
803
  [[package]]
867
804
  name = "thiserror"
868
- version = "1.0.49"
805
+ version = "1.0.51"
869
806
  source = "registry+https://github.com/rust-lang/crates.io-index"
870
- checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4"
807
+ checksum = "f11c217e1416d6f036b870f14e0413d480dbf28edbee1f877abaf0206af43bb7"
871
808
  dependencies = [
872
809
  "thiserror-impl",
873
810
  ]
874
811
 
875
812
  [[package]]
876
813
  name = "thiserror-impl"
877
- version = "1.0.49"
814
+ version = "1.0.51"
878
815
  source = "registry+https://github.com/rust-lang/crates.io-index"
879
- checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc"
816
+ checksum = "01742297787513b79cf8e29d1056ede1313e2420b7b3b15d0a768b4921f549df"
880
817
  dependencies = [
881
818
  "proc-macro2",
882
819
  "quote",
883
- "syn 2.0.38",
820
+ "syn 2.0.41",
884
821
  ]
885
822
 
886
823
  [[package]]
887
824
  name = "time"
888
- version = "0.3.29"
825
+ version = "0.3.31"
889
826
  source = "registry+https://github.com/rust-lang/crates.io-index"
890
- checksum = "426f806f4089c493dcac0d24c29c01e2c38baf8e30f1b716ee37e83d200b18fe"
827
+ checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e"
891
828
  dependencies = [
892
829
  "deranged",
893
830
  "itoa",
831
+ "powerfmt",
894
832
  "serde",
895
833
  "time-core",
896
834
  "time-macros",
@@ -904,9 +842,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3"
904
842
 
905
843
  [[package]]
906
844
  name = "time-macros"
907
- version = "0.2.15"
845
+ version = "0.2.16"
908
846
  source = "registry+https://github.com/rust-lang/crates.io-index"
909
- checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20"
847
+ checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f"
910
848
  dependencies = [
911
849
  "time-core",
912
850
  ]
@@ -945,6 +883,60 @@ dependencies = [
945
883
  "winapi-util",
946
884
  ]
947
885
 
886
+ [[package]]
887
+ name = "wasm-bindgen"
888
+ version = "0.2.89"
889
+ source = "registry+https://github.com/rust-lang/crates.io-index"
890
+ checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e"
891
+ dependencies = [
892
+ "cfg-if",
893
+ "wasm-bindgen-macro",
894
+ ]
895
+
896
+ [[package]]
897
+ name = "wasm-bindgen-backend"
898
+ version = "0.2.89"
899
+ source = "registry+https://github.com/rust-lang/crates.io-index"
900
+ checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826"
901
+ dependencies = [
902
+ "bumpalo",
903
+ "log",
904
+ "once_cell",
905
+ "proc-macro2",
906
+ "quote",
907
+ "syn 2.0.41",
908
+ "wasm-bindgen-shared",
909
+ ]
910
+
911
+ [[package]]
912
+ name = "wasm-bindgen-macro"
913
+ version = "0.2.89"
914
+ source = "registry+https://github.com/rust-lang/crates.io-index"
915
+ checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2"
916
+ dependencies = [
917
+ "quote",
918
+ "wasm-bindgen-macro-support",
919
+ ]
920
+
921
+ [[package]]
922
+ name = "wasm-bindgen-macro-support"
923
+ version = "0.2.89"
924
+ source = "registry+https://github.com/rust-lang/crates.io-index"
925
+ checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283"
926
+ dependencies = [
927
+ "proc-macro2",
928
+ "quote",
929
+ "syn 2.0.41",
930
+ "wasm-bindgen-backend",
931
+ "wasm-bindgen-shared",
932
+ ]
933
+
934
+ [[package]]
935
+ name = "wasm-bindgen-shared"
936
+ version = "0.2.89"
937
+ source = "registry+https://github.com/rust-lang/crates.io-index"
938
+ checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f"
939
+
948
940
  [[package]]
949
941
  name = "winapi"
950
942
  version = "0.3.9"
@@ -978,18 +970,18 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
978
970
 
979
971
  [[package]]
980
972
  name = "windows-sys"
981
- version = "0.48.0"
973
+ version = "0.52.0"
982
974
  source = "registry+https://github.com/rust-lang/crates.io-index"
983
- checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
975
+ checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
984
976
  dependencies = [
985
977
  "windows-targets",
986
978
  ]
987
979
 
988
980
  [[package]]
989
981
  name = "windows-targets"
990
- version = "0.48.5"
982
+ version = "0.52.0"
991
983
  source = "registry+https://github.com/rust-lang/crates.io-index"
992
- checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"
984
+ checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd"
993
985
  dependencies = [
994
986
  "windows_aarch64_gnullvm",
995
987
  "windows_aarch64_msvc",
@@ -1002,51 +994,45 @@ dependencies = [
1002
994
 
1003
995
  [[package]]
1004
996
  name = "windows_aarch64_gnullvm"
1005
- version = "0.48.5"
997
+ version = "0.52.0"
1006
998
  source = "registry+https://github.com/rust-lang/crates.io-index"
1007
- checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
999
+ checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea"
1008
1000
 
1009
1001
  [[package]]
1010
1002
  name = "windows_aarch64_msvc"
1011
- version = "0.48.5"
1003
+ version = "0.52.0"
1012
1004
  source = "registry+https://github.com/rust-lang/crates.io-index"
1013
- checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
1005
+ checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef"
1014
1006
 
1015
1007
  [[package]]
1016
1008
  name = "windows_i686_gnu"
1017
- version = "0.48.5"
1009
+ version = "0.52.0"
1018
1010
  source = "registry+https://github.com/rust-lang/crates.io-index"
1019
- checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
1011
+ checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313"
1020
1012
 
1021
1013
  [[package]]
1022
1014
  name = "windows_i686_msvc"
1023
- version = "0.48.5"
1015
+ version = "0.52.0"
1024
1016
  source = "registry+https://github.com/rust-lang/crates.io-index"
1025
- checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
1017
+ checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a"
1026
1018
 
1027
1019
  [[package]]
1028
1020
  name = "windows_x86_64_gnu"
1029
- version = "0.48.5"
1021
+ version = "0.52.0"
1030
1022
  source = "registry+https://github.com/rust-lang/crates.io-index"
1031
- checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
1023
+ checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd"
1032
1024
 
1033
1025
  [[package]]
1034
1026
  name = "windows_x86_64_gnullvm"
1035
- version = "0.48.5"
1027
+ version = "0.52.0"
1036
1028
  source = "registry+https://github.com/rust-lang/crates.io-index"
1037
- checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
1029
+ checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e"
1038
1030
 
1039
1031
  [[package]]
1040
1032
  name = "windows_x86_64_msvc"
1041
- version = "0.48.5"
1042
- source = "registry+https://github.com/rust-lang/crates.io-index"
1043
- checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
1044
-
1045
- [[package]]
1046
- name = "xdg"
1047
- version = "2.5.2"
1033
+ version = "0.52.0"
1048
1034
  source = "registry+https://github.com/rust-lang/crates.io-index"
1049
- checksum = "213b7324336b53d2414b2db8537e56544d981803139155afa84f76eeebb7a546"
1035
+ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04"
1050
1036
 
1051
1037
  [[package]]
1052
1038
  name = "yaml-rust"
data/README.md CHANGED
@@ -25,7 +25,7 @@ Try on command line:
25
25
  rake compile
26
26
  bin/console
27
27
 
28
- GLFMMarkdown.to_html('# header', options: {sourcepos: true})
28
+ GLFMMarkdown.to_html('# header', options: { glfm: true })
29
29
  ```
30
30
 
31
31
  ## Development
@@ -33,8 +33,8 @@ GLFMMarkdown.to_html('# header', options: {sourcepos: true})
33
33
  A command line executable can be built for debugging.
34
34
 
35
35
  ```
36
- cd ext/glfm_markdown
37
- cargo run --bin glfm_markdown -- --sourcepos
36
+ cargo run --bin glfm_markdown --features="cli" -- --help
37
+ cargo run --bin glfm_markdown --features="cli" -- --sourcepos
38
38
  ```
39
39
 
40
40
  There is a VSCode workspace that allows you to `Debug executable`
@@ -1,8 +1,9 @@
1
1
  [package]
2
2
  name = "glfm_markdown"
3
- version = "0.0.3"
3
+ version = "0.0.8"
4
4
  edition = "2021"
5
5
  authors = ["digitalmoksha <bwalker@gitlab.com>"]
6
+ description = "GitLab Flavored Markdown parser and formatter. 100% CommonMark-compatible. Experimental."
6
7
  publish = false
7
8
 
8
9
  [lib]
@@ -10,10 +11,13 @@ crate-type = ["cdylib"]
10
11
 
11
12
  [[bin]]
12
13
  name = "glfm_markdown"
14
+ required-features = ["cli"]
13
15
 
14
16
  [dependencies]
15
- magnus = { version = "0.5" }
16
- rb-sys = { version = "0.9.82", default-features = false, features = ["stable-api-compiled-fallback"] }
17
- argparse = { version = ">= 0.2.1" }
18
- comrak = { version = "0.19.0" }
19
- anstream = { version = "0.4" } # TODO keep until we upgrade to rustc 1.70.0 or newer
17
+ clap = { version = "4.0", optional = true, features = ["derive", "string"] }
18
+ comrak = { version = "0.20.0", default-features = false }
19
+ magnus = "0.6.2"
20
+ rb-sys = { version = "0.9.83", default-features = false, features = ["stable-api-compiled-fallback"] }
21
+
22
+ [features]
23
+ cli = ["clap", "comrak/syntect"]
@@ -3,4 +3,6 @@
3
3
  require 'mkmf'
4
4
  require 'rb_sys/mkmf'
5
5
 
6
- create_rust_makefile('glfm_markdown')
6
+ create_rust_makefile('glfm_markdown') do |r|
7
+ r.auto_install_rust_toolchain = false
8
+ end
@@ -1,6 +1,23 @@
1
1
  #[derive(Debug)]
2
2
  pub struct RenderOptions {
3
+ pub autolink: bool,
4
+ pub escape: bool,
5
+ pub description_lists: bool,
6
+ pub footnotes: bool,
7
+ pub full_info_string: bool,
8
+ pub github_pre_lang: bool,
9
+ pub hardbreaks: bool,
10
+ pub relaxed_autolinks: bool,
11
+ pub relaxed_tasklist_character: bool,
3
12
  pub sourcepos: bool,
13
+ pub smart: bool,
14
+ pub strikethrough: bool,
15
+ pub superscript: bool,
16
+ pub table: bool,
17
+ pub tagfilter: bool,
18
+ pub tasklist: bool,
19
+ pub unsafe_: bool,
20
+
4
21
  pub debug: bool,
5
22
  }
6
23
 
@@ -11,20 +28,25 @@ pub fn render(text: String, options: RenderOptions) -> String {
11
28
  fn render_comrak(text: String, options: RenderOptions) -> String {
12
29
  let mut comrak_options = comrak::ComrakOptions::default();
13
30
 
14
- comrak_options.extension.strikethrough = true;
15
- comrak_options.extension.table = true;
16
- comrak_options.extension.autolink = true;
17
- comrak_options.extension.tasklist = false;
18
- comrak_options.extension.footnotes = true;
31
+ comrak_options.extension.autolink = options.autolink;
32
+ comrak_options.extension.description_lists = options.description_lists;
33
+ comrak_options.extension.footnotes = options.footnotes;
34
+ comrak_options.extension.strikethrough = options.strikethrough;
35
+ comrak_options.extension.superscript = options.superscript;
36
+ comrak_options.extension.table = options.table;
37
+ comrak_options.extension.tagfilter = options.tagfilter;
38
+ comrak_options.extension.tasklist = options.tasklist;
19
39
 
20
- comrak_options.render.unsafe_ = true;
21
- comrak_options.render.github_pre_lang = true;
22
- comrak_options.render.full_info_string = true;
23
- comrak_options.render.hardbreaks = false;
40
+ comrak_options.render.escape = options.escape;
41
+ comrak_options.render.full_info_string = options.full_info_string;
42
+ comrak_options.render.github_pre_lang = options.github_pre_lang;
43
+ comrak_options.render.hardbreaks = options.hardbreaks;
24
44
  comrak_options.render.sourcepos = options.sourcepos;
45
+ comrak_options.render.unsafe_ = options.unsafe_;
25
46
 
26
- comrak_options.parse.smart = false;
27
- comrak_options.parse.relaxed_autolinks = false;
47
+ comrak_options.parse.relaxed_autolinks = options.relaxed_autolinks;
48
+ comrak_options.parse.relaxed_tasklist_matching = options.relaxed_tasklist_character;
49
+ comrak_options.parse.smart = options.smart;
28
50
 
29
51
  comrak::markdown_to_html(&text, &comrak_options)
30
52
  }
@@ -3,10 +3,33 @@ use magnus::{define_module, function, prelude::*, Error, RHash, Symbol};
3
3
  mod glfm;
4
4
  use glfm::{render, RenderOptions};
5
5
 
6
+ /// Lookup symbol in provided `RHash`. Returns `false` if the key is not present
7
+ /// or value cannot be converted to a boolean.
8
+ fn get_opt(arg: &str, options: RHash) -> bool {
9
+ options.lookup(Symbol::new(arg)).unwrap_or_default()
10
+ }
11
+
6
12
  pub fn render_to_html_rs(text: String, options: RHash) -> String {
7
- let sourcepos: bool = options.lookup::<_, bool>(Symbol::new("sourcepos")).unwrap();
8
- let debug: bool = options.lookup::<_, bool>(Symbol::new("debug")).unwrap();
9
- let render_options = RenderOptions { sourcepos, debug };
13
+ let render_options = RenderOptions {
14
+ autolink: get_opt("autolink", options),
15
+ description_lists: get_opt("description_lists", options),
16
+ escape: get_opt("escape", options),
17
+ footnotes: get_opt("footnotes", options),
18
+ full_info_string: get_opt("full_info_string", options),
19
+ github_pre_lang: get_opt("github_pre_lang", options),
20
+ hardbreaks: get_opt("hardbreaks", options),
21
+ relaxed_autolinks: get_opt("relaxed_autolinks", options),
22
+ relaxed_tasklist_character: get_opt("relaxed_tasklist_character", options),
23
+ sourcepos: get_opt("sourcepos", options),
24
+ smart: get_opt("smart", options),
25
+ strikethrough: get_opt("strikethrough", options),
26
+ superscript: get_opt("superscript", options),
27
+ table: get_opt("table", options),
28
+ tagfilter: get_opt("tagfilter", options),
29
+ tasklist: get_opt("tasklist", options),
30
+ unsafe_: get_opt("unsafe", options),
31
+ debug: get_opt("debug", options),
32
+ };
10
33
 
11
34
  render(text, render_options)
12
35
  }
@@ -3,52 +3,132 @@ use glfm::{render, RenderOptions};
3
3
  use std::io::Read;
4
4
  use std::io::Write;
5
5
 
6
+ use clap::Parser;
7
+
8
+ #[derive(Parser, Debug)]
9
+ #[command(author, version, about, long_about = None)]
10
+ struct Args {
11
+ /// CommonMark file(s) to parse; or standard input if none passed
12
+ #[arg(value_name = "FILE")]
13
+ file: Option<String>,
14
+
15
+ /// Enable 'autolink' extension
16
+ #[arg(long)]
17
+ autolink: bool,
18
+
19
+ /// Enable 'description-lists' extension
20
+ #[arg(long)]
21
+ description_lists: bool,
22
+
23
+ /// Escape raw HTML instead of clobbering it
24
+ #[arg(long)]
25
+ escape: bool,
26
+
27
+ /// Enable 'footnotes' extension
28
+ #[arg(long)]
29
+ footnotes: bool,
30
+
31
+ /// Enable full info strings for code blocks
32
+ #[arg(long)]
33
+ full_info_string: bool,
34
+
35
+ /// Use GitHub-style <pre lang> for code blocks
36
+ #[arg(long)]
37
+ github_pre_lang: bool,
38
+
39
+ /// Treat newlines as hard line breaks
40
+ #[arg(long)]
41
+ hardbreaks: bool,
42
+
43
+ /// Write output to FILE instead of stdout
44
+ #[arg(short, long, value_name = "FILE")]
45
+ output: Option<String>,
46
+
47
+ /// Enable relaxing of autolink parsing, allowing links to be recognized when in brackets
48
+ #[arg(long)]
49
+ relaxed_autolinks: bool,
50
+
51
+ /// Enable relaxing which character is allowed in a tasklists
52
+ #[arg(long)]
53
+ relaxed_tasklist_character: bool,
54
+
55
+ /// Include source mappings in HTML attributes
56
+ #[arg(long)]
57
+ sourcepos: bool,
58
+
59
+ /// Use smart punctuation
60
+ #[arg(long)]
61
+ smart: bool,
62
+
63
+ /// Enable 'strikethrough' extension
64
+ #[arg(long)]
65
+ strikethrough: bool,
66
+
67
+ /// Enable 'superscript' extension
68
+ #[arg(long)]
69
+ superscript: bool,
70
+
71
+ /// Enable 'table' extension
72
+ #[arg(long)]
73
+ table: bool,
74
+
75
+ /// Enable 'tagfilter' extension
76
+ #[arg(long)]
77
+ tagfilter: bool,
78
+
79
+ /// Enable 'tasklist' extension
80
+ #[arg(long)]
81
+ tasklist: bool,
82
+
83
+ /// Allow raw HTML and dangerous URLs
84
+ #[arg(long = "unsafe")]
85
+ unsafe_: bool,
86
+
87
+ /// Show debug information
88
+ #[arg(long)]
89
+ debug: bool,
90
+ }
91
+
6
92
  fn main() {
7
- let mut input = "-".to_owned();
8
- let mut output = "-".to_owned();
9
- let mut sourcepos = false;
10
- let mut debug = false;
11
-
12
- {
13
- // this block limits scope of borrows by cli.refer() method
14
- let mut cli = argparse::ArgumentParser::new();
15
-
16
- cli.set_description("Gitlab Flavored Markdown. Experimental.");
17
-
18
- cli.refer(&mut input)
19
- .add_argument("file", argparse::Store, "File to read");
20
- cli.refer(&mut output)
21
- .add_option(&["-o", "--output"], argparse::Store, "File to write");
22
- cli.refer(&mut sourcepos).add_option(
23
- &["--sourcepos"],
24
- argparse::StoreTrue,
25
- "Include source mappings in HTML attributes.",
26
- );
27
- cli.refer(&mut debug).add_option(
28
- &["--debug"],
29
- argparse::StoreTrue,
30
- "Show debug information",
31
- );
32
-
33
- cli.parse_args_or_exit();
34
- }
35
-
36
- let vec = if input == "-" {
37
- let mut vec = Vec::new();
38
- std::io::stdin().read_to_end(&mut vec).unwrap();
39
- vec
40
- } else {
41
- std::fs::read(input).unwrap()
93
+ let mut s: Vec<u8> = Vec::with_capacity(2048);
94
+ let cli = Args::parse();
95
+
96
+ match cli.file {
97
+ None => {
98
+ std::io::stdin().read_to_end(&mut s).unwrap();
99
+ }
100
+ Some(fs) => {
101
+ s = std::fs::read(fs).unwrap();
102
+ }
42
103
  };
43
104
 
44
- let source = String::from_utf8_lossy(&vec);
45
- let options = RenderOptions { sourcepos, debug };
105
+ let source = String::from_utf8_lossy(&s);
106
+ let options = RenderOptions {
107
+ autolink: cli.autolink,
108
+ description_lists: cli.description_lists,
109
+ escape: cli.escape,
110
+ footnotes: cli.footnotes,
111
+ full_info_string: cli.full_info_string,
112
+ github_pre_lang: cli.github_pre_lang,
113
+ hardbreaks: cli.hardbreaks,
114
+ relaxed_autolinks: cli.relaxed_autolinks,
115
+ relaxed_tasklist_character: cli.relaxed_tasklist_character,
116
+ sourcepos: cli.sourcepos,
117
+ smart: cli.smart,
118
+ strikethrough: cli.strikethrough,
119
+ superscript: cli.superscript,
120
+ table: cli.table,
121
+ tagfilter: cli.tagfilter,
122
+ tasklist: cli.tasklist,
123
+ unsafe_: cli.unsafe_,
124
+ debug: cli.debug,
125
+ };
46
126
 
47
127
  let result = render(source.to_string(), options);
48
128
 
49
- if output == "-" {
50
- std::io::stdout().write_all(result.as_bytes()).unwrap();
129
+ if let Some(output_filename) = cli.output {
130
+ std::fs::write(output_filename, &result).unwrap();
51
131
  } else {
52
- std::fs::write(output, &result).unwrap();
53
- }
132
+ std::io::stdout().write_all(result.as_bytes()).unwrap();
133
+ };
54
134
  }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GLFMMarkdown
4
- VERSION = '0.0.7'
4
+ VERSION = '0.0.8'
5
5
  end
data/lib/glfm_markdown.rb CHANGED
@@ -5,7 +5,23 @@ require_relative 'glfm_markdown/loader'
5
5
 
6
6
  load_rust_extension
7
7
 
8
- DEFAULT_OPTIONS = { sourcepos: true, debug: false }.freeze
8
+ GLFM_DEFAULT_OPTIONS = {
9
+ autolink: true,
10
+ footnotes: true,
11
+ full_info_string: true,
12
+ github_pre_lang: false,
13
+ hardbreaks: false,
14
+ relaxed_autolinks: false,
15
+ sourcepos: true,
16
+ smart: false,
17
+ strikethrough: true,
18
+ table: true,
19
+ tagfilter: false,
20
+ tasklist: true,
21
+ unsafe: true,
22
+
23
+ debug: false
24
+ }.freeze
9
25
 
10
26
  module GLFMMarkdown
11
27
  class << self
@@ -14,7 +30,10 @@ module GLFMMarkdown
14
30
  raise TypeError, 'markdown must be UTF-8 encoded' unless markdown.encoding.name == "UTF-8"
15
31
  raise TypeError, 'options must be a Hash' unless options.is_a?(Hash)
16
32
 
17
- render_to_html_rs(markdown, DEFAULT_OPTIONS.merge(options))
33
+ default_options = options[:glfm] ? GLFM_DEFAULT_OPTIONS : {}
34
+ options = options.merge(unsafe: true) if options[:tagfilter]
35
+
36
+ render_to_html_rs(markdown, default_options.merge(options))
18
37
  end
19
38
  end
20
39
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab-glfm-markdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: arm64-darwin
6
6
  authors:
7
7
  - Brett Walker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-19 00:00:00.000000000 Z
11
+ date: 2023-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rb_sys
@@ -25,19 +25,19 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0.9'
27
27
  - !ruby/object:Gem::Dependency
28
- name: pry
28
+ name: pry-byebug
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.12.2
33
+ version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 0.12.2
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement