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 +4 -4
- data/CHANGELOG.md +8 -0
- data/Cargo.lock +76 -76
- data/ext/inkmark/Cargo.toml +2 -2
- data/ext/inkmark/src/chunks_by_heading.rs +30 -30
- data/ext/inkmark/src/document.rs +1 -1
- data/ext/inkmark/src/emoji.rs +7 -18
- data/ext/inkmark/src/handler.rs +1 -5
- data/ext/inkmark/src/stats.rs +4 -6
- data/ext/inkmark/src/toc.rs +2 -2
- data/lib/inkmark/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 99be70c153a0446a98b513e0546389622cb5815d5907388f0b9160da7b1652cc
|
|
4
|
+
data.tar.gz: b156f0536a351ef5780816a10ccedbb4d5a5a3a6c8741f2ccbbd065247f249ed
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
|
70
|
+
version = "2.13.2"
|
|
71
71
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
72
|
-
checksum = "
|
|
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.
|
|
95
|
+
version = "1.0.5"
|
|
96
96
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
97
|
-
checksum = "
|
|
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.
|
|
112
|
+
version = "1.5.3"
|
|
113
113
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
114
|
-
checksum = "
|
|
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.
|
|
133
|
+
"syn 3.0.9",
|
|
134
134
|
]
|
|
135
135
|
|
|
136
136
|
[[package]]
|
|
137
137
|
name = "either"
|
|
138
|
-
version = "1.
|
|
138
|
+
version = "1.19.0"
|
|
139
139
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
140
|
-
checksum = "
|
|
140
|
+
checksum = "0e9c71c2167ca323c882b99918929403426e2373ea17242ff5653e0d5e1058be"
|
|
141
141
|
|
|
142
142
|
[[package]]
|
|
143
143
|
name = "emojis"
|
|
144
|
-
version = "0.9.
|
|
144
|
+
version = "0.9.1"
|
|
145
145
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
146
|
-
checksum = "
|
|
146
|
+
checksum = "589871e639330783bc20ad89d32ac1b049e02c273d96c907ca27478c8bc674a2"
|
|
147
147
|
dependencies = [
|
|
148
148
|
"phf",
|
|
149
149
|
]
|
|
150
150
|
|
|
151
151
|
[[package]]
|
|
152
152
|
name = "equivalent"
|
|
153
|
-
version = "1.0.
|
|
153
|
+
version = "1.0.3"
|
|
154
154
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
155
|
-
checksum = "
|
|
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.
|
|
232
|
+
version = "2.4.0"
|
|
233
233
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
234
|
-
checksum = "
|
|
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.
|
|
246
|
+
version = "2.4.0"
|
|
247
247
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
248
|
-
checksum = "
|
|
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.
|
|
259
|
+
version = "2.4.0"
|
|
260
260
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
261
|
-
checksum = "
|
|
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.
|
|
273
|
+
version = "2.4.0"
|
|
274
274
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
275
|
-
checksum = "
|
|
275
|
+
checksum = "20f0088bfb7441f7a37fa0c9e20cb1e9cba1cac6b9ce8cd2a6dc44294f8e8cbc"
|
|
276
276
|
|
|
277
277
|
[[package]]
|
|
278
278
|
name = "icu_properties"
|
|
279
|
-
version = "2.
|
|
279
|
+
version = "2.4.0"
|
|
280
280
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
281
|
-
checksum = "
|
|
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.
|
|
294
|
+
version = "2.4.0"
|
|
295
295
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
296
|
-
checksum = "
|
|
296
|
+
checksum = "b98f29af82d02b163fe50161388350e743bb3107cc8e8c2f7314cb505faddfcf"
|
|
297
297
|
|
|
298
298
|
[[package]]
|
|
299
299
|
name = "icu_provider"
|
|
300
|
-
version = "2.
|
|
300
|
+
version = "2.4.0"
|
|
301
301
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
302
|
-
checksum = "
|
|
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.
|
|
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.
|
|
366
|
+
version = "1.5.1"
|
|
367
367
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
368
|
-
checksum = "
|
|
368
|
+
checksum = "20870f649af7073d53e38067b2a84312175d56ea15217e1b15bc83506ec50afb"
|
|
369
369
|
|
|
370
370
|
[[package]]
|
|
371
371
|
name = "libc"
|
|
372
|
-
version = "0.2.
|
|
372
|
+
version = "0.2.191"
|
|
373
373
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
374
|
-
checksum = "
|
|
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.
|
|
409
|
+
version = "0.9.3"
|
|
410
410
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
411
|
-
checksum = "
|
|
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.
|
|
421
|
+
version = "0.9.1"
|
|
422
422
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
423
|
-
checksum = "
|
|
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.
|
|
512
|
+
version = "0.13.5"
|
|
513
513
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
514
|
-
checksum = "
|
|
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.
|
|
530
|
+
version = "22.0.3"
|
|
531
531
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
532
|
-
checksum = "
|
|
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.
|
|
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.
|
|
696
|
+
version = "1.0.4"
|
|
697
697
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
698
|
-
checksum = "
|
|
698
|
+
checksum = "33f4fe9184a62d842c9ef383018f3306d8ba224fd9d836f56d7288308847c256"
|
|
699
699
|
|
|
700
700
|
[[package]]
|
|
701
701
|
name = "smallvec"
|
|
702
|
-
version = "1.16.
|
|
702
|
+
version = "1.16.4"
|
|
703
703
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
704
|
-
checksum = "
|
|
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.
|
|
725
|
+
version = "3.0.9"
|
|
726
726
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
727
|
-
checksum = "
|
|
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.
|
|
736
|
+
version = "0.14.0"
|
|
737
737
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
738
|
-
checksum = "
|
|
738
|
+
checksum = "901704edd0dfe137f1987838ee4f259e4e063c31371bdb423f7ae38ec6f77f02"
|
|
739
739
|
dependencies = [
|
|
740
740
|
"proc-macro2",
|
|
741
741
|
"quote",
|
|
742
|
-
"syn
|
|
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.
|
|
765
|
+
version = "2.0.21"
|
|
766
766
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
767
|
-
checksum = "
|
|
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.
|
|
774
|
+
version = "2.0.21"
|
|
775
775
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
776
|
-
checksum = "
|
|
776
|
+
checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524"
|
|
777
777
|
dependencies = [
|
|
778
778
|
"proc-macro2",
|
|
779
779
|
"quote",
|
|
780
|
-
"syn 3.0.
|
|
780
|
+
"syn 3.0.9",
|
|
781
781
|
]
|
|
782
782
|
|
|
783
783
|
[[package]]
|
|
784
784
|
name = "tinystr"
|
|
785
|
-
version = "0.8.
|
|
785
|
+
version = "0.8.5"
|
|
786
786
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
787
|
-
checksum = "
|
|
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.
|
|
795
|
+
version = "2.10.0"
|
|
796
796
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
797
|
-
checksum = "
|
|
797
|
+
checksum = "357cc3acc6a036009fd6c973ed009037c732d60d0b4f6c673e9041497482a28f"
|
|
798
798
|
|
|
799
799
|
[[package]]
|
|
800
800
|
name = "unicode-ident"
|
|
801
|
-
version = "1.0.
|
|
801
|
+
version = "1.0.27"
|
|
802
802
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
803
|
-
checksum = "
|
|
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.
|
|
880
|
+
version = "0.8.4"
|
|
881
881
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
882
|
-
checksum = "
|
|
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.
|
|
891
|
+
version = "0.8.4"
|
|
892
892
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
893
|
-
checksum = "
|
|
893
|
+
checksum = "ec8ebde2db3681e8c9980cc27822030e68752690ddfa9473e739aeb4dbde6d71"
|
|
894
894
|
dependencies = [
|
|
895
895
|
"proc-macro2",
|
|
896
896
|
"quote",
|
|
897
|
-
"syn
|
|
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.
|
|
912
|
+
version = "0.1.8"
|
|
913
913
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
914
|
-
checksum = "
|
|
914
|
+
checksum = "f75b4683f6c7f45248d4d64056a24298c6281e0993356d7d1b4a1a962ef10d4a"
|
|
915
915
|
dependencies = [
|
|
916
916
|
"proc-macro2",
|
|
917
917
|
"quote",
|
|
918
|
-
"syn
|
|
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.
|
|
935
|
+
version = "0.11.9"
|
|
936
936
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
937
|
-
checksum = "
|
|
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.
|
|
946
|
+
version = "0.11.7"
|
|
947
947
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
948
|
-
checksum = "
|
|
948
|
+
checksum = "c3743ddbf47738d929cd1ae2e199d40d0162979dfe31aef8ae646d2bf00bf97a"
|
|
949
949
|
dependencies = [
|
|
950
950
|
"proc-macro2",
|
|
951
951
|
"quote",
|
|
952
|
-
"syn 3.0.
|
|
952
|
+
"syn 3.0.9",
|
|
953
953
|
]
|
|
954
954
|
|
|
955
955
|
[[package]]
|
|
956
956
|
name = "zlib-rs"
|
|
957
|
-
version = "0.6.
|
|
957
|
+
version = "0.6.8"
|
|
958
958
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
959
|
-
checksum = "
|
|
959
|
+
checksum = "b268e58e7c693d7c271f93ffc4ba3b380412554231c85bf61ca7af91042a4112"
|
data/ext/inkmark/Cargo.toml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "inkmark"
|
|
3
|
-
version = "0.2.
|
|
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.
|
|
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
|
|
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
|
-
|
|
93
|
-
boundary,
|
|
94
|
-
section_end,
|
|
93
|
+
boundary.level,
|
|
95
94
|
&heading_text,
|
|
96
95
|
&breadcrumb,
|
|
96
|
+
content_events,
|
|
97
97
|
&mut dedup,
|
|
98
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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(
|
|
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) =
|
|
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
|
}
|
data/ext/inkmark/src/document.rs
CHANGED
|
@@ -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
|
|
286
|
+
plain_text::write_plain_text(events, &mut buf);
|
|
287
287
|
buf
|
|
288
288
|
}
|
|
289
289
|
|
data/ext/inkmark/src/emoji.rs
CHANGED
|
@@ -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
|
|
19
|
+
pub fn replace(events: &mut [Event<'_>]) {
|
|
20
20
|
let mut code_depth: usize = 0;
|
|
21
21
|
|
|
22
|
-
for
|
|
23
|
-
match
|
|
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(
|
|
33
|
-
|
|
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
|
}
|
data/ext/inkmark/src/handler.rs
CHANGED
|
@@ -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
|
|
data/ext/inkmark/src/stats.rs
CHANGED
|
@@ -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
|
-
//!
|
|
19
|
+
//! detection (`to_statistics_hash`)
|
|
20
20
|
//! - `extract: {...}` => filtered arrays of structured
|
|
21
|
-
//!
|
|
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
|
-
|
|
298
|
-
text_buf.push(' ');
|
|
299
|
-
}
|
|
296
|
+
Event::SoftBreak | Event::HardBreak if !in_code_block => {
|
|
297
|
+
text_buf.push(' ');
|
|
300
298
|
}
|
|
301
299
|
_ => {}
|
|
302
300
|
}
|
data/ext/inkmark/src/toc.rs
CHANGED
|
@@ -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.
|
|
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.
|
|
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();
|
data/lib/inkmark/version.rb
CHANGED
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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: []
|