inkmark 0.2.0 → 0.2.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 426fe02b791d8fcf0b3d080cea874692f3027eb1528e07300de6685b869108e3
4
- data.tar.gz: b1e8947dc0811dfcd70bc29b62c34c95536526f512941e73bd66664d5c5b7473
3
+ metadata.gz: 99be70c153a0446a98b513e0546389622cb5815d5907388f0b9160da7b1652cc
4
+ data.tar.gz: b156f0536a351ef5780816a10ccedbb4d5a5a3a6c8741f2ccbbd065247f249ed
5
5
  SHA512:
6
- metadata.gz: 07d38e9bf03538f52a444d033fa48648bd235673c3c435e7137bd5435b31e82dce00b758b038840577540d451a1d8d82bbd8660d9be99429b0a7ed35a666b4b3
7
- data.tar.gz: 9898e5c9780a4ea2423861f62b3054459d7c3dadad7ae9fb999fe3b5416a51a513df9b7d428f1a4af5093a67cc91eb86f7be5fc2c3054d9456b805a65e7b4438
6
+ metadata.gz: b7dcd628ed44d5c5ab757f257c95f2b23ad6880835f68db65f735ba45a6f7666de1bff0be3cc6e088ba18f3407848db0cc9c63d970e1a415bba1451ac58a15d7
7
+ data.tar.gz: b704a73b47b7e85db26b13b1c02dc5a840939fea7eed13b9f4e7b68f816a23add8ed1bc60d3278656d3f4951dad318519ac14d257286ea513abbcf55dc7d622e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [0.2.2] - 2026-10-24
2
+
3
+ - Updated dependencies, including pulldown-cmark 0.13.5 (upstream security fixes) and magnus 0.9.3.
4
+
5
+ ## [0.2.1] - 2026-09-25
6
+
7
+ - Updated dependencies, including magnus 0.9.
8
+
1
9
  ## [0.2.0] - 2026-09-06
2
10
 
3
11
  - Ractor-safe: the native extension declares `rb_ext_ractor_safe`, and every public API works from non-main Ractors.
data/Cargo.lock CHANGED
@@ -67,9 +67,9 @@ checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7"
67
67
 
68
68
  [[package]]
69
69
  name = "bitflags"
70
- version = "2.13.1"
70
+ version = "2.13.2"
71
71
  source = "registry+https://github.com/rust-lang/crates.io-index"
72
- checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da"
72
+ checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06"
73
73
 
74
74
  [[package]]
75
75
  name = "bstr"
@@ -92,9 +92,9 @@ dependencies = [
92
92
 
93
93
  [[package]]
94
94
  name = "cfg-if"
95
- version = "1.0.4"
95
+ version = "1.0.5"
96
96
  source = "registry+https://github.com/rust-lang/crates.io-index"
97
- checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
97
+ checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600"
98
98
 
99
99
  [[package]]
100
100
  name = "clang-sys"
@@ -109,9 +109,9 @@ dependencies = [
109
109
 
110
110
  [[package]]
111
111
  name = "crc32fast"
112
- version = "1.5.1"
112
+ version = "1.5.3"
113
113
  source = "registry+https://github.com/rust-lang/crates.io-index"
114
- checksum = "8498c871161e1742aaa9d52551b2d6ebdd4c3d45a3be423e3728f33b955be550"
114
+ checksum = "0ba106e844045ddc02c20768ac4b0b7cb45f2cc2ecbd833ac9f5dacb183c2055"
115
115
  dependencies = [
116
116
  "cfg-if",
117
117
  ]
@@ -130,29 +130,29 @@ checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8"
130
130
  dependencies = [
131
131
  "proc-macro2",
132
132
  "quote",
133
- "syn 3.0.5",
133
+ "syn 3.0.9",
134
134
  ]
135
135
 
136
136
  [[package]]
137
137
  name = "either"
138
- version = "1.18.0"
138
+ version = "1.19.0"
139
139
  source = "registry+https://github.com/rust-lang/crates.io-index"
140
- checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34"
140
+ checksum = "0e9c71c2167ca323c882b99918929403426e2373ea17242ff5653e0d5e1058be"
141
141
 
142
142
  [[package]]
143
143
  name = "emojis"
144
- version = "0.9.0"
144
+ version = "0.9.1"
145
145
  source = "registry+https://github.com/rust-lang/crates.io-index"
146
- checksum = "0b1514ced566c94991ed9563258ecf61e311fd773bf0a3f20606830386bf66e3"
146
+ checksum = "589871e639330783bc20ad89d32ac1b049e02c273d96c907ca27478c8bc674a2"
147
147
  dependencies = [
148
148
  "phf",
149
149
  ]
150
150
 
151
151
  [[package]]
152
152
  name = "equivalent"
153
- version = "1.0.2"
153
+ version = "1.0.3"
154
154
  source = "registry+https://github.com/rust-lang/crates.io-index"
155
- checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
155
+ checksum = "00d174d5400e5e8fd687ad1049e2f578285fa914201b1af7e8b112a4546bd826"
156
156
 
157
157
  [[package]]
158
158
  name = "fancy-regex"
@@ -229,9 +229,9 @@ dependencies = [
229
229
 
230
230
  [[package]]
231
231
  name = "icu_collections"
232
- version = "2.3.0"
232
+ version = "2.4.0"
233
233
  source = "registry+https://github.com/rust-lang/crates.io-index"
234
- checksum = "fa68d21081c4a05d5a901a1c62add574c77048b6a1c67be3b50ce0b60d4ca513"
234
+ checksum = "fe090a42a0d3140fed8c63263ed1fecc02422cb2f4bfe55cd8de2de1b8e105dd"
235
235
  dependencies = [
236
236
  "displaydoc",
237
237
  "potential_utf",
@@ -243,9 +243,9 @@ dependencies = [
243
243
 
244
244
  [[package]]
245
245
  name = "icu_locale_core"
246
- version = "2.3.0"
246
+ version = "2.4.0"
247
247
  source = "registry+https://github.com/rust-lang/crates.io-index"
248
- checksum = "d56e28588da92eee5c3201a6eff33fabdd49b62269c8938d4ff050ce4d900deb"
248
+ checksum = "25d29b57c17c6528d0dc4c2141cfa2d08200465acb537a3909c8b9b8a4a984c0"
249
249
  dependencies = [
250
250
  "displaydoc",
251
251
  "litemap",
@@ -256,9 +256,9 @@ dependencies = [
256
256
 
257
257
  [[package]]
258
258
  name = "icu_normalizer"
259
- version = "2.3.0"
259
+ version = "2.4.0"
260
260
  source = "registry+https://github.com/rust-lang/crates.io-index"
261
- checksum = "12f9cf5f235641ed274641dd81c3f28d870e276763d0797aeeab72317b1c646f"
261
+ checksum = "404a3b8c486f205c87fe7f23ab6894d84a4ad76d6e4671ae1981ba7def87c599"
262
262
  dependencies = [
263
263
  "icu_collections",
264
264
  "icu_normalizer_data",
@@ -270,15 +270,15 @@ dependencies = [
270
270
 
271
271
  [[package]]
272
272
  name = "icu_normalizer_data"
273
- version = "2.3.0"
273
+ version = "2.4.0"
274
274
  source = "registry+https://github.com/rust-lang/crates.io-index"
275
- checksum = "1563da1ed3e0b3bf3d74c9b85917ac9c56464d2f57242270c09c9e752f8021a0"
275
+ checksum = "20f0088bfb7441f7a37fa0c9e20cb1e9cba1cac6b9ce8cd2a6dc44294f8e8cbc"
276
276
 
277
277
  [[package]]
278
278
  name = "icu_properties"
279
- version = "2.3.0"
279
+ version = "2.4.0"
280
280
  source = "registry+https://github.com/rust-lang/crates.io-index"
281
- checksum = "7e7ca276ad3145661a65914e6daf131ca5120cd3dcee8f8f3214b8875184a148"
281
+ checksum = "2ea83d991c56158f7cf898bf86436c1dfe7c07ee82fe88951f2695c9f37a379f"
282
282
  dependencies = [
283
283
  "displaydoc",
284
284
  "icu_collections",
@@ -291,15 +291,15 @@ dependencies = [
291
291
 
292
292
  [[package]]
293
293
  name = "icu_properties_data"
294
- version = "2.3.0"
294
+ version = "2.4.0"
295
295
  source = "registry+https://github.com/rust-lang/crates.io-index"
296
- checksum = "e590f038c1464a96894fd6d10127e90a8be4509f56ff7ecef851b15cee0b7caa"
296
+ checksum = "b98f29af82d02b163fe50161388350e743bb3107cc8e8c2f7314cb505faddfcf"
297
297
 
298
298
  [[package]]
299
299
  name = "icu_provider"
300
- version = "2.3.1"
300
+ version = "2.4.0"
301
301
  source = "registry+https://github.com/rust-lang/crates.io-index"
302
- checksum = "d27bbb9d3abbefac45d55f647c9de1d44aafcd1186eb91879afef17c396c3e73"
302
+ checksum = "413099315636c588ee8f011190b329b971a09a8fae9d157e01dcae8379468514"
303
303
  dependencies = [
304
304
  "displaydoc",
305
305
  "icu_locale_core",
@@ -333,7 +333,7 @@ dependencies = [
333
333
 
334
334
  [[package]]
335
335
  name = "inkmark"
336
- version = "0.2.0"
336
+ version = "0.2.2"
337
337
  dependencies = [
338
338
  "deunicode",
339
339
  "emojis",
@@ -363,15 +363,15 @@ dependencies = [
363
363
 
364
364
  [[package]]
365
365
  name = "lazy_static"
366
- version = "1.5.0"
366
+ version = "1.5.1"
367
367
  source = "registry+https://github.com/rust-lang/crates.io-index"
368
- checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
368
+ checksum = "20870f649af7073d53e38067b2a84312175d56ea15217e1b15bc83506ec50afb"
369
369
 
370
370
  [[package]]
371
371
  name = "libc"
372
- version = "0.2.189"
372
+ version = "0.2.191"
373
373
  source = "registry+https://github.com/rust-lang/crates.io-index"
374
- checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2"
374
+ checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a"
375
375
 
376
376
  [[package]]
377
377
  name = "libloading"
@@ -406,9 +406,9 @@ checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6"
406
406
 
407
407
  [[package]]
408
408
  name = "magnus"
409
- version = "0.8.2"
409
+ version = "0.9.3"
410
410
  source = "registry+https://github.com/rust-lang/crates.io-index"
411
- checksum = "3b36a5b126bbe97eb0d02d07acfeb327036c6319fd816139a49824a83b7f9012"
411
+ checksum = "40ef424404d166cbb71c8b8d19c9c589c748c4547c1afa1928c5504299f6c713"
412
412
  dependencies = [
413
413
  "magnus-macros",
414
414
  "rb-sys",
@@ -418,9 +418,9 @@ dependencies = [
418
418
 
419
419
  [[package]]
420
420
  name = "magnus-macros"
421
- version = "0.8.0"
421
+ version = "0.9.1"
422
422
  source = "registry+https://github.com/rust-lang/crates.io-index"
423
- checksum = "47607461fd8e1513cb4f2076c197d8092d921a1ea75bd08af97398f593751892"
423
+ checksum = "9dafde2eeb66f090e0f326112323eb8324b12cb32b5d1210e541d3df6b0ce77e"
424
424
  dependencies = [
425
425
  "proc-macro2",
426
426
  "quote",
@@ -509,9 +509,9 @@ dependencies = [
509
509
 
510
510
  [[package]]
511
511
  name = "pulldown-cmark"
512
- version = "0.13.4"
512
+ version = "0.13.5"
513
513
  source = "registry+https://github.com/rust-lang/crates.io-index"
514
- checksum = "e9f068eba8e7071c5f9511831b44f32c740d5adf574e990f946ddb53db2f314e"
514
+ checksum = "278e9268c93b9e498a2da46c34d90ba93a3255eb99009646398f34bc73ab36eb"
515
515
  dependencies = [
516
516
  "bitflags",
517
517
  "memchr",
@@ -527,9 +527,9 @@ checksum = "007d8adb5ddab6f8e3f491ac63566a7d5002cc7ed73901f72057943fa71ae1ae"
527
527
 
528
528
  [[package]]
529
529
  name = "pulldown-cmark-to-cmark"
530
- version = "22.0.1"
530
+ version = "22.0.3"
531
531
  source = "registry+https://github.com/rust-lang/crates.io-index"
532
- checksum = "ab1ad36992cead65f02aa399a373a42730922f1525d988172634fdefdecb8a60"
532
+ checksum = "84bbb29c624230c4bd1047bbdb2aa47e41c860e9665ce62ba9504eebe91bf867"
533
533
  dependencies = [
534
534
  "pulldown-cmark",
535
535
  ]
@@ -670,7 +670,7 @@ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
670
670
  dependencies = [
671
671
  "proc-macro2",
672
672
  "quote",
673
- "syn 3.0.5",
673
+ "syn 3.0.9",
674
674
  ]
675
675
 
676
676
  [[package]]
@@ -693,15 +693,15 @@ checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea"
693
693
 
694
694
  [[package]]
695
695
  name = "siphasher"
696
- version = "1.0.3"
696
+ version = "1.0.4"
697
697
  source = "registry+https://github.com/rust-lang/crates.io-index"
698
- checksum = "8ee5873ec9cce0195efcb7a4e9507a04cd49aec9c83d0389df45b1ef7ba2e649"
698
+ checksum = "33f4fe9184a62d842c9ef383018f3306d8ba224fd9d836f56d7288308847c256"
699
699
 
700
700
  [[package]]
701
701
  name = "smallvec"
702
- version = "1.16.0"
702
+ version = "1.16.4"
703
703
  source = "registry+https://github.com/rust-lang/crates.io-index"
704
- checksum = "b9be42f50aa861c555654aa3a37f52f4b1074bacf4e48fe0ef7fa584e80f1f0f"
704
+ checksum = "d0d5d4b1981b8bbbb7aed204cae5726d683d5d6ac7e74ec54122ea28f315e7c8"
705
705
 
706
706
  [[package]]
707
707
  name = "stable_deref_trait"
@@ -722,9 +722,9 @@ dependencies = [
722
722
 
723
723
  [[package]]
724
724
  name = "syn"
725
- version = "3.0.5"
725
+ version = "3.0.9"
726
726
  source = "registry+https://github.com/rust-lang/crates.io-index"
727
- checksum = "12df2e0110f65b775f769bb17ef989067a1d931b2eb822bd4346631eeada89f9"
727
+ checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b"
728
728
  dependencies = [
729
729
  "proc-macro2",
730
730
  "quote",
@@ -733,13 +733,13 @@ dependencies = [
733
733
 
734
734
  [[package]]
735
735
  name = "synstructure"
736
- version = "0.13.2"
736
+ version = "0.14.0"
737
737
  source = "registry+https://github.com/rust-lang/crates.io-index"
738
- checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2"
738
+ checksum = "901704edd0dfe137f1987838ee4f259e4e063c31371bdb423f7ae38ec6f77f02"
739
739
  dependencies = [
740
740
  "proc-macro2",
741
741
  "quote",
742
- "syn 2.0.119",
742
+ "syn 3.0.9",
743
743
  ]
744
744
 
745
745
  [[package]]
@@ -762,29 +762,29 @@ dependencies = [
762
762
 
763
763
  [[package]]
764
764
  name = "thiserror"
765
- version = "2.0.20"
765
+ version = "2.0.21"
766
766
  source = "registry+https://github.com/rust-lang/crates.io-index"
767
- checksum = "ec86235f5fcc2a73650310756d2ac5b138a5780bbbdfae3eeccec992c435ba4f"
767
+ checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e"
768
768
  dependencies = [
769
769
  "thiserror-impl",
770
770
  ]
771
771
 
772
772
  [[package]]
773
773
  name = "thiserror-impl"
774
- version = "2.0.20"
774
+ version = "2.0.21"
775
775
  source = "registry+https://github.com/rust-lang/crates.io-index"
776
- checksum = "bc04cd3e1236dd4a98afca4569f2deb3f120e5422a4023be2cb683f8486292af"
776
+ checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524"
777
777
  dependencies = [
778
778
  "proc-macro2",
779
779
  "quote",
780
- "syn 3.0.5",
780
+ "syn 3.0.9",
781
781
  ]
782
782
 
783
783
  [[package]]
784
784
  name = "tinystr"
785
- version = "0.8.4"
785
+ version = "0.8.5"
786
786
  source = "registry+https://github.com/rust-lang/crates.io-index"
787
- checksum = "b1e27c91459209c2986af3dcf603a5a74a4368754ce37414f59acc971167f643"
787
+ checksum = "abc840c238154d58f9e86b2792261edfde565a17696e1cda1a449de27979801a"
788
788
  dependencies = [
789
789
  "displaydoc",
790
790
  "zerovec",
@@ -792,15 +792,15 @@ dependencies = [
792
792
 
793
793
  [[package]]
794
794
  name = "unicase"
795
- version = "2.9.0"
795
+ version = "2.10.0"
796
796
  source = "registry+https://github.com/rust-lang/crates.io-index"
797
- checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142"
797
+ checksum = "357cc3acc6a036009fd6c973ed009037c732d60d0b4f6c673e9041497482a28f"
798
798
 
799
799
  [[package]]
800
800
  name = "unicode-ident"
801
- version = "1.0.24"
801
+ version = "1.0.27"
802
802
  source = "registry+https://github.com/rust-lang/crates.io-index"
803
- checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
803
+ checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
804
804
 
805
805
  [[package]]
806
806
  name = "unicode-segmentation"
@@ -877,9 +877,9 @@ checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc"
877
877
 
878
878
  [[package]]
879
879
  name = "yoke"
880
- version = "0.8.3"
880
+ version = "0.8.4"
881
881
  source = "registry+https://github.com/rust-lang/crates.io-index"
882
- checksum = "709fe23a0424b6a435d82152b1bd3fdfb0833487d5fa90d05d42762a9891fef5"
882
+ checksum = "417ef3fcf6c300b7dbd25c85531a746931c02ad536f3cf4786ed1e88223340b3"
883
883
  dependencies = [
884
884
  "stable_deref_trait",
885
885
  "yoke-derive",
@@ -888,13 +888,13 @@ dependencies = [
888
888
 
889
889
  [[package]]
890
890
  name = "yoke-derive"
891
- version = "0.8.2"
891
+ version = "0.8.4"
892
892
  source = "registry+https://github.com/rust-lang/crates.io-index"
893
- checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e"
893
+ checksum = "ec8ebde2db3681e8c9980cc27822030e68752690ddfa9473e739aeb4dbde6d71"
894
894
  dependencies = [
895
895
  "proc-macro2",
896
896
  "quote",
897
- "syn 2.0.119",
897
+ "syn 3.0.9",
898
898
  "synstructure",
899
899
  ]
900
900
 
@@ -909,13 +909,13 @@ dependencies = [
909
909
 
910
910
  [[package]]
911
911
  name = "zerofrom-derive"
912
- version = "0.1.7"
912
+ version = "0.1.8"
913
913
  source = "registry+https://github.com/rust-lang/crates.io-index"
914
- checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1"
914
+ checksum = "f75b4683f6c7f45248d4d64056a24298c6281e0993356d7d1b4a1a962ef10d4a"
915
915
  dependencies = [
916
916
  "proc-macro2",
917
917
  "quote",
918
- "syn 2.0.119",
918
+ "syn 3.0.9",
919
919
  "synstructure",
920
920
  ]
921
921
 
@@ -932,9 +932,9 @@ dependencies = [
932
932
 
933
933
  [[package]]
934
934
  name = "zerovec"
935
- version = "0.11.8"
935
+ version = "0.11.9"
936
936
  source = "registry+https://github.com/rust-lang/crates.io-index"
937
- checksum = "bb0464e17806c1d976d5cba29399c7f08e516e279e2ba493f63123b5fca67dd8"
937
+ checksum = "f58a2799cfe9a1670c7ea8edbd52ef8edb93cb37a7f83bf31ba9e35d9dae6a40"
938
938
  dependencies = [
939
939
  "yoke",
940
940
  "zerofrom",
@@ -943,17 +943,17 @@ dependencies = [
943
943
 
944
944
  [[package]]
945
945
  name = "zerovec-derive"
946
- version = "0.11.6"
946
+ version = "0.11.7"
947
947
  source = "registry+https://github.com/rust-lang/crates.io-index"
948
- checksum = "34df6fc39dbd26ddc9c10e6a2984476e13acce22e64e4487636ef494369225da"
948
+ checksum = "c3743ddbf47738d929cd1ae2e199d40d0162979dfe31aef8ae646d2bf00bf97a"
949
949
  dependencies = [
950
950
  "proc-macro2",
951
951
  "quote",
952
- "syn 3.0.5",
952
+ "syn 3.0.9",
953
953
  ]
954
954
 
955
955
  [[package]]
956
956
  name = "zlib-rs"
957
- version = "0.6.7"
957
+ version = "0.6.8"
958
958
  source = "registry+https://github.com/rust-lang/crates.io-index"
959
- checksum = "34b31d188d9d685a4f9c7b46d6e36631b07058d2cfe190267adce54dc230bf12"
959
+ checksum = "b268e58e7c693d7c271f93ffc4ba3b380412554231c85bf61ca7af91042a4112"
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "inkmark"
3
- version = "0.2.0"
3
+ version = "0.2.2"
4
4
  edition = "2021"
5
5
  authors = ["Yaroslav Markin <yaroslav@markin.net>"]
6
6
  license = "MIT"
@@ -10,7 +10,7 @@ publish = false
10
10
  crate-type = ["cdylib"]
11
11
 
12
12
  [dependencies]
13
- magnus = { version = "0.8.2" }
13
+ magnus = { version = "0.9.0", default-features = false }
14
14
  rb-sys = { version = "0.9.130", features = ["stable-api-compiled-fallback"] }
15
15
  pulldown-cmark = { version = "0.13", default-features = false, features = ["html", "simd"] }
16
16
  pulldown-cmark-escape = "0.11"
@@ -54,17 +54,15 @@ pub fn native_chunks_by_heading(
54
54
  // when there are no headings at all. Emitted as an entry with
55
55
  // `heading: nil, level: 0, id: nil`. Skipped entirely when there
56
56
  // is no non-empty content before the first heading.
57
- let with_counts = flags.statistics;
57
+ let content_opts = ContentOptions {
58
+ with_counts: flags.statistics,
59
+ truncate_params: truncate_params.as_ref(),
60
+ };
58
61
  let preamble_end = boundaries.first().map(|b| b.start).unwrap_or(events.len());
59
62
  if preamble_end > 0 {
60
63
  let preamble_events = &events[0..preamble_end];
61
64
  if !is_empty_content(preamble_events) {
62
- result.push(build_preamble_hash(
63
- ruby,
64
- preamble_events,
65
- with_counts,
66
- truncate_params.as_ref(),
67
- )?)?;
65
+ result.push(build_preamble_hash(ruby, preamble_events, &content_opts)?)?;
68
66
  }
69
67
  }
70
68
 
@@ -87,16 +85,17 @@ pub fn native_chunks_by_heading(
87
85
  }
88
86
  let breadcrumb: Vec<&str> = ancestors.iter().map(|(_, t)| t.as_str()).collect();
89
87
  let heading_text = collect_inline_text(&events[(boundary.start + 1)..boundary.end]);
88
+ // Content = events after End(Heading) up to the next section or
89
+ // end of document. Re-serialized through cmark_write.
90
+ let content_events = &events[(boundary.end + 1)..section_end];
90
91
  let hash = build_section_hash(
91
92
  ruby,
92
- &events,
93
- boundary,
94
- section_end,
93
+ boundary.level,
95
94
  &heading_text,
96
95
  &breadcrumb,
96
+ content_events,
97
97
  &mut dedup,
98
- with_counts,
99
- truncate_params.as_ref(),
98
+ &content_opts,
100
99
  )?;
101
100
  result.push(hash)?;
102
101
  ancestors.push((level, heading_text));
@@ -113,6 +112,13 @@ struct HeadingBoundary {
113
112
  level: HeadingLevel,
114
113
  }
115
114
 
115
+ /// How each entry's `content` is rendered: optionally truncated, and
116
+ /// optionally accompanied by `character_count` / `word_count`.
117
+ struct ContentOptions<'a> {
118
+ with_counts: bool,
119
+ truncate_params: Option<&'a TruncateParams>,
120
+ }
121
+
116
122
  fn find_heading_boundaries(events: &[Event<'_>]) -> Vec<HeadingBoundary> {
117
123
  let mut boundaries = Vec::new();
118
124
  let mut i = 0;
@@ -165,8 +171,7 @@ fn find_section_end(boundaries: &[HeadingBoundary], i: usize, events_len: usize)
165
171
  fn build_preamble_hash(
166
172
  ruby: &Ruby,
167
173
  events: &[Event<'_>],
168
- with_counts: bool,
169
- truncate_params: Option<&TruncateParams>,
174
+ content_opts: &ContentOptions<'_>,
170
175
  ) -> Result<RHash, Error> {
171
176
  let hash = ruby.hash_new();
172
177
  hash.aset(ruby.to_symbol("heading"), ())?;
@@ -176,12 +181,12 @@ fn build_preamble_hash(
176
181
  // with proper sections so callers can treat every entry alike.
177
182
  hash.aset(ruby.to_symbol("breadcrumb"), ruby.ary_new_capa(0))?;
178
183
 
179
- let content = match truncate_params {
184
+ let content = match content_opts.truncate_params {
180
185
  Some(params) => truncate::truncate_events(events, params),
181
186
  None => render_markdown(events),
182
187
  };
183
- if with_counts {
184
- let (chars, words) = count_post_truncate(events, truncate_params, &content);
188
+ if content_opts.with_counts {
189
+ let (chars, words) = count_post_truncate(events, content_opts.truncate_params, &content);
185
190
  hash.aset(ruby.to_symbol("character_count"), chars)?;
186
191
  hash.aset(ruby.to_symbol("word_count"), words)?;
187
192
  }
@@ -191,14 +196,12 @@ fn build_preamble_hash(
191
196
 
192
197
  fn build_section_hash(
193
198
  ruby: &Ruby,
194
- events: &[Event<'_>],
195
- boundary: &HeadingBoundary,
196
- section_end: usize,
199
+ level: HeadingLevel,
197
200
  heading_text: &str,
198
201
  breadcrumb: &[&str],
202
+ content_events: &[Event<'_>],
199
203
  dedup: &mut SlugDeduplicator,
200
- with_counts: bool,
201
- truncate_params: Option<&TruncateParams>,
204
+ content_opts: &ContentOptions<'_>,
202
205
  ) -> Result<RHash, Error> {
203
206
  // Slug is the deduplicated slugify of the (filter-applied) heading
204
207
  // text, matching the ids `heading_ids` / `toc` would emit for the
@@ -210,13 +213,9 @@ fn build_section_hash(
210
213
  dedup.deduplicate(base)
211
214
  };
212
215
 
213
- // Content = events after End(Heading) up to the next section or
214
- // end of document. Re-serialized through cmark_write.
215
- let content_events = &events[(boundary.end + 1)..section_end];
216
-
217
216
  let hash = ruby.hash_new();
218
217
  hash.aset(ruby.to_symbol("heading"), heading_text)?;
219
- hash.aset(ruby.to_symbol("level"), toc::level_to_u8(boundary.level))?;
218
+ hash.aset(ruby.to_symbol("level"), toc::level_to_u8(level))?;
220
219
  if id.is_empty() {
221
220
  hash.aset(ruby.to_symbol("id"), ())?;
222
221
  } else {
@@ -228,12 +227,13 @@ fn build_section_hash(
228
227
  }
229
228
  hash.aset(ruby.to_symbol("breadcrumb"), breadcrumb_arr)?;
230
229
 
231
- let content = match truncate_params {
230
+ let content = match content_opts.truncate_params {
232
231
  Some(params) => truncate::truncate_events(content_events, params),
233
232
  None => render_markdown(content_events),
234
233
  };
235
- if with_counts {
236
- let (chars, words) = count_post_truncate(content_events, truncate_params, &content);
234
+ if content_opts.with_counts {
235
+ let (chars, words) =
236
+ count_post_truncate(content_events, content_opts.truncate_params, &content);
237
237
  hash.aset(ruby.to_symbol("character_count"), chars)?;
238
238
  hash.aset(ruby.to_symbol("word_count"), words)?;
239
239
  }
@@ -283,7 +283,7 @@ fn render_to_plain_text(source: &str, cm_opts: pulldown_cmark::Options, flags: F
283
283
  }
284
284
 
285
285
  let events = apply_filters(parser.collect(), &flags);
286
- plain_text::write_plain_text(events.into_iter(), &mut buf);
286
+ plain_text::write_plain_text(events, &mut buf);
287
287
  buf
288
288
  }
289
289
 
@@ -16,34 +16,23 @@ use pulldown_cmark::{CowStr, Event, Tag, TagEnd};
16
16
  /// Tracks code-block nesting depth so shortcodes inside fenced code blocks
17
17
  /// are preserved. Inline code (`Event::Code`) is passed through untouched
18
18
  /// because we only scan `Event::Text` events.
19
- pub fn replace(events: &mut Vec<Event<'_>>) {
19
+ pub fn replace(events: &mut [Event<'_>]) {
20
20
  let mut code_depth: usize = 0;
21
21
 
22
- for i in 0..events.len() {
23
- match &events[i] {
22
+ for event in events.iter_mut() {
23
+ match event {
24
24
  Event::Start(Tag::CodeBlock(_)) => {
25
25
  code_depth += 1;
26
- continue;
27
26
  }
28
27
  Event::End(TagEnd::CodeBlock) => {
29
28
  code_depth = code_depth.saturating_sub(1);
30
- continue;
31
29
  }
32
- Event::Text(_) if code_depth == 0 => {}
33
- _ => continue,
34
- }
35
-
36
- // Take ownership of the text so we can feed it to `replace_shortcodes`
37
- // and emit a new Text event with the result.
38
- if let Event::Text(text) = std::mem::replace(&mut events[i], Event::SoftBreak) {
39
- match replace_shortcodes(&text) {
40
- Some(replaced) => {
41
- events[i] = Event::Text(CowStr::Boxed(replaced.into_boxed_str()));
42
- }
43
- None => {
44
- events[i] = Event::Text(text);
30
+ Event::Text(text) if code_depth == 0 => {
31
+ if let Some(replaced) = replace_shortcodes(text) {
32
+ *text = CowStr::Boxed(replaced.into_boxed_str());
45
33
  }
46
34
  }
35
+ _ => {}
47
36
  }
48
37
  }
49
38
  }
@@ -696,11 +696,7 @@ fn apply_mutations(node: &mut Node, event_obj: Value, _ruby: &Ruby) -> Result<()
696
696
  Ok(())
697
697
  }
698
698
 
699
- pub fn dispatch_handlers(
700
- nodes: &mut Vec<Node>,
701
- handlers: &RHash,
702
- ruby: &Ruby,
703
- ) -> Result<(), Error> {
699
+ pub fn dispatch_handlers(nodes: &mut [Node], handlers: &RHash, ruby: &Ruby) -> Result<(), Error> {
704
700
  for node in nodes.iter_mut() {
705
701
  dispatch_handlers(&mut node.children, handlers, ruby)?;
706
702
 
@@ -16,9 +16,9 @@
16
16
  //! The collector is the single source of truth for the full-render path.
17
17
  //! Two independent Ruby-side knobs consume its output:
18
18
  //! - `statistics: true` => scalar counts and language
19
- //! detection (`to_statistics_hash`)
19
+ //! detection (`to_statistics_hash`)
20
20
  //! - `extract: {...}` => filtered arrays of structured
21
- //! records (`to_extracts_hash`)
21
+ //! records (`to_extracts_hash`)
22
22
 
23
23
  use std::ops::Range;
24
24
 
@@ -293,10 +293,8 @@ pub fn collect(events: &[(Event<'_>, Range<usize>)]) -> Stats {
293
293
  }
294
294
  }
295
295
  }
296
- Event::SoftBreak | Event::HardBreak => {
297
- if !in_code_block {
298
- text_buf.push(' ');
299
- }
296
+ Event::SoftBreak | Event::HardBreak if !in_code_block => {
297
+ text_buf.push(' ');
300
298
  }
301
299
  _ => {}
302
300
  }
@@ -22,7 +22,7 @@ pub struct TocEntry {
22
22
  pub fn toc_to_markdown(entries: &[TocEntry], max_depth: Option<u8>) -> String {
23
23
  let filtered: Vec<&TocEntry> = entries
24
24
  .iter()
25
- .filter(|e| max_depth.map_or(true, |max| level_to_u8(e.level) <= max))
25
+ .filter(|e| max_depth.is_none_or(|max| level_to_u8(e.level) <= max))
26
26
  .collect();
27
27
  if filtered.is_empty() {
28
28
  return String::new();
@@ -61,7 +61,7 @@ pub fn toc_to_markdown(entries: &[TocEntry], max_depth: Option<u8>) -> String {
61
61
  pub fn toc_to_html(entries: &[TocEntry], max_depth: Option<u8>) -> String {
62
62
  let filtered: Vec<&TocEntry> = entries
63
63
  .iter()
64
- .filter(|e| max_depth.map_or(true, |max| level_to_u8(e.level) <= max))
64
+ .filter(|e| max_depth.is_none_or(|max| level_to_u8(e.level) <= max))
65
65
  .collect();
66
66
  if filtered.is_empty() {
67
67
  return String::new();
@@ -2,5 +2,5 @@
2
2
 
3
3
  class Inkmark
4
4
  # Current gem version.
5
- VERSION = "0.2.0"
5
+ VERSION = "0.2.2"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inkmark
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yaroslav Markin
@@ -113,14 +113,14 @@ dependencies:
113
113
  requirements:
114
114
  - - "~>"
115
115
  - !ruby/object:Gem::Version
116
- version: 2.1.5
116
+ version: '2.2'
117
117
  type: :development
118
118
  prerelease: false
119
119
  version_requirements: !ruby/object:Gem::Requirement
120
120
  requirements:
121
121
  - - "~>"
122
122
  - !ruby/object:Gem::Version
123
- version: 2.1.5
123
+ version: '2.2'
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: rake-compiler
126
126
  requirement: !ruby/object:Gem::Requirement
@@ -202,7 +202,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
202
202
  - !ruby/object:Gem::Version
203
203
  version: '0'
204
204
  requirements: []
205
- rubygems_version: 4.0.16
205
+ rubygems_version: 4.0.20
206
206
  specification_version: 4
207
207
  summary: Very fast, feature-packed, AI-first Markdown gem for Ruby.
208
208
  test_files: []