css_inline 0.18.0 → 0.19.0
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/Cargo.lock +40 -71
- data/README.md +8 -7
- data/ext/css_inline/Cargo.lock +40 -71
- data/ext/css_inline/Cargo.toml +4 -4
- data/ext/css_inline/src/lib.rs +7 -3
- metadata +2 -58
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 46a0dbf3f59f4816cfc59c003d673c2ef2deab486eed68cc68ae6a0ae6f4a6e9
|
|
4
|
+
data.tar.gz: dafe99e7c4cefd62e9403d33af1dc377896380e88f45dfa014b2bbd984c80854
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2a5c0cddddb393591e0dd44539a766ee1670c913c1bd2af6560d04c0d3b85319264f9ab12c57157a10d5b48746dbf021696e030fcf80dbe71aa20947a6b96f92
|
|
7
|
+
data.tar.gz: dbe646ab29cc80e8439bbf2d6100212b0bac5393d879efe24b95471283460c94da5050ccc2c0d2638b6bbfa77d454df32048507f69154c58893fa6c828552ad9
|
data/Cargo.lock
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# This file is automatically @generated by Cargo.
|
|
2
2
|
# It is not intended for manual editing.
|
|
3
|
-
version =
|
|
3
|
+
version = 4
|
|
4
4
|
|
|
5
5
|
[[package]]
|
|
6
6
|
name = "aho-corasick"
|
|
@@ -136,13 +136,12 @@ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
|
|
|
136
136
|
|
|
137
137
|
[[package]]
|
|
138
138
|
name = "css-inline"
|
|
139
|
-
version = "0.
|
|
139
|
+
version = "0.19.0"
|
|
140
140
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
141
|
-
checksum = "
|
|
141
|
+
checksum = "2a6803e80ade2d53b280935cbaf6f124c38c26aeb6cae3c276123bdd13aeb3a8"
|
|
142
142
|
dependencies = [
|
|
143
143
|
"cssparser",
|
|
144
144
|
"html5ever",
|
|
145
|
-
"indexmap",
|
|
146
145
|
"lru",
|
|
147
146
|
"precomputed-hash",
|
|
148
147
|
"reqwest",
|
|
@@ -163,9 +162,9 @@ dependencies = [
|
|
|
163
162
|
|
|
164
163
|
[[package]]
|
|
165
164
|
name = "cssparser"
|
|
166
|
-
version = "0.
|
|
165
|
+
version = "0.36.0"
|
|
167
166
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
168
|
-
checksum = "
|
|
167
|
+
checksum = "dae61cf9c0abb83bd659dab65b7e4e38d8236824c85f0f804f173567bda257d2"
|
|
169
168
|
dependencies = [
|
|
170
169
|
"cssparser-macros",
|
|
171
170
|
"dtoa-short",
|
|
@@ -242,6 +241,12 @@ version = "1.0.2"
|
|
|
242
241
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
243
242
|
checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
|
|
244
243
|
|
|
244
|
+
[[package]]
|
|
245
|
+
name = "fastrand"
|
|
246
|
+
version = "2.3.0"
|
|
247
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
248
|
+
checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
|
|
249
|
+
|
|
245
250
|
[[package]]
|
|
246
251
|
name = "find-msvc-tools"
|
|
247
252
|
version = "0.1.4"
|
|
@@ -375,13 +380,12 @@ dependencies = [
|
|
|
375
380
|
|
|
376
381
|
[[package]]
|
|
377
382
|
name = "html5ever"
|
|
378
|
-
version = "0.
|
|
383
|
+
version = "0.36.1"
|
|
379
384
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
380
|
-
checksum = "
|
|
385
|
+
checksum = "6452c4751a24e1b99c3260d505eaeee76a050573e61f30ac2c924ddc7236f01e"
|
|
381
386
|
dependencies = [
|
|
382
387
|
"log",
|
|
383
388
|
"markup5ever",
|
|
384
|
-
"match_token",
|
|
385
389
|
]
|
|
386
390
|
|
|
387
391
|
[[package]]
|
|
@@ -588,16 +592,6 @@ dependencies = [
|
|
|
588
592
|
"icu_properties",
|
|
589
593
|
]
|
|
590
594
|
|
|
591
|
-
[[package]]
|
|
592
|
-
name = "indexmap"
|
|
593
|
-
version = "2.12.0"
|
|
594
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
595
|
-
checksum = "6717a8d2a5a929a1a2eb43a12812498ed141a0bcfb7e8f7844fbdbe4303bba9f"
|
|
596
|
-
dependencies = [
|
|
597
|
-
"equivalent",
|
|
598
|
-
"hashbrown",
|
|
599
|
-
]
|
|
600
|
-
|
|
601
595
|
[[package]]
|
|
602
596
|
name = "ipnet"
|
|
603
597
|
version = "2.11.0"
|
|
@@ -734,26 +728,15 @@ dependencies = [
|
|
|
734
728
|
|
|
735
729
|
[[package]]
|
|
736
730
|
name = "markup5ever"
|
|
737
|
-
version = "0.
|
|
731
|
+
version = "0.36.1"
|
|
738
732
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
739
|
-
checksum = "
|
|
733
|
+
checksum = "6c3294c4d74d0742910f8c7b466f44dda9eb2d5742c1e430138df290a1e8451c"
|
|
740
734
|
dependencies = [
|
|
741
735
|
"log",
|
|
742
736
|
"tendril",
|
|
743
737
|
"web_atoms",
|
|
744
738
|
]
|
|
745
739
|
|
|
746
|
-
[[package]]
|
|
747
|
-
name = "match_token"
|
|
748
|
-
version = "0.35.0"
|
|
749
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
750
|
-
checksum = "ac84fd3f360fcc43dc5f5d186f02a94192761a080e8bc58621ad4d12296a58cf"
|
|
751
|
-
dependencies = [
|
|
752
|
-
"proc-macro2",
|
|
753
|
-
"quote",
|
|
754
|
-
"syn",
|
|
755
|
-
]
|
|
756
|
-
|
|
757
740
|
[[package]]
|
|
758
741
|
name = "memchr"
|
|
759
742
|
version = "2.7.6"
|
|
@@ -830,19 +813,20 @@ checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
|
|
|
830
813
|
|
|
831
814
|
[[package]]
|
|
832
815
|
name = "phf"
|
|
833
|
-
version = "0.
|
|
816
|
+
version = "0.13.1"
|
|
834
817
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
835
|
-
checksum = "
|
|
818
|
+
checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf"
|
|
836
819
|
dependencies = [
|
|
837
820
|
"phf_macros",
|
|
838
821
|
"phf_shared",
|
|
822
|
+
"serde",
|
|
839
823
|
]
|
|
840
824
|
|
|
841
825
|
[[package]]
|
|
842
826
|
name = "phf_codegen"
|
|
843
|
-
version = "0.
|
|
827
|
+
version = "0.13.1"
|
|
844
828
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
845
|
-
checksum = "
|
|
829
|
+
checksum = "49aa7f9d80421bca176ca8dbfebe668cc7a2684708594ec9f3c0db0805d5d6e1"
|
|
846
830
|
dependencies = [
|
|
847
831
|
"phf_generator",
|
|
848
832
|
"phf_shared",
|
|
@@ -850,19 +834,19 @@ dependencies = [
|
|
|
850
834
|
|
|
851
835
|
[[package]]
|
|
852
836
|
name = "phf_generator"
|
|
853
|
-
version = "0.
|
|
837
|
+
version = "0.13.1"
|
|
854
838
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
855
|
-
checksum = "
|
|
839
|
+
checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737"
|
|
856
840
|
dependencies = [
|
|
841
|
+
"fastrand",
|
|
857
842
|
"phf_shared",
|
|
858
|
-
"rand 0.8.5",
|
|
859
843
|
]
|
|
860
844
|
|
|
861
845
|
[[package]]
|
|
862
846
|
name = "phf_macros"
|
|
863
|
-
version = "0.
|
|
847
|
+
version = "0.13.1"
|
|
864
848
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
865
|
-
checksum = "
|
|
849
|
+
checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef"
|
|
866
850
|
dependencies = [
|
|
867
851
|
"phf_generator",
|
|
868
852
|
"phf_shared",
|
|
@@ -873,9 +857,9 @@ dependencies = [
|
|
|
873
857
|
|
|
874
858
|
[[package]]
|
|
875
859
|
name = "phf_shared"
|
|
876
|
-
version = "0.
|
|
860
|
+
version = "0.13.1"
|
|
877
861
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
878
|
-
checksum = "
|
|
862
|
+
checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266"
|
|
879
863
|
dependencies = [
|
|
880
864
|
"siphasher",
|
|
881
865
|
]
|
|
@@ -954,7 +938,7 @@ dependencies = [
|
|
|
954
938
|
"bytes",
|
|
955
939
|
"getrandom 0.3.4",
|
|
956
940
|
"lru-slab",
|
|
957
|
-
"rand
|
|
941
|
+
"rand",
|
|
958
942
|
"ring",
|
|
959
943
|
"rustc-hash 2.1.1",
|
|
960
944
|
"rustls",
|
|
@@ -995,15 +979,6 @@ version = "5.3.0"
|
|
|
995
979
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
996
980
|
checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
|
|
997
981
|
|
|
998
|
-
[[package]]
|
|
999
|
-
name = "rand"
|
|
1000
|
-
version = "0.8.5"
|
|
1001
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1002
|
-
checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
|
|
1003
|
-
dependencies = [
|
|
1004
|
-
"rand_core 0.6.4",
|
|
1005
|
-
]
|
|
1006
|
-
|
|
1007
982
|
[[package]]
|
|
1008
983
|
name = "rand"
|
|
1009
984
|
version = "0.9.2"
|
|
@@ -1011,7 +986,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
1011
986
|
checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1"
|
|
1012
987
|
dependencies = [
|
|
1013
988
|
"rand_chacha",
|
|
1014
|
-
"rand_core
|
|
989
|
+
"rand_core",
|
|
1015
990
|
]
|
|
1016
991
|
|
|
1017
992
|
[[package]]
|
|
@@ -1021,15 +996,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
1021
996
|
checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb"
|
|
1022
997
|
dependencies = [
|
|
1023
998
|
"ppv-lite86",
|
|
1024
|
-
"rand_core
|
|
999
|
+
"rand_core",
|
|
1025
1000
|
]
|
|
1026
1001
|
|
|
1027
|
-
[[package]]
|
|
1028
|
-
name = "rand_core"
|
|
1029
|
-
version = "0.6.4"
|
|
1030
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1031
|
-
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
|
|
1032
|
-
|
|
1033
1002
|
[[package]]
|
|
1034
1003
|
name = "rand_core"
|
|
1035
1004
|
version = "0.9.3"
|
|
@@ -1248,9 +1217,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
|
|
|
1248
1217
|
|
|
1249
1218
|
[[package]]
|
|
1250
1219
|
name = "selectors"
|
|
1251
|
-
version = "0.
|
|
1220
|
+
version = "0.33.0"
|
|
1252
1221
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1253
|
-
checksum = "
|
|
1222
|
+
checksum = "feef350c36147532e1b79ea5c1f3791373e61cbd9a6a2615413b3807bb164fb7"
|
|
1254
1223
|
dependencies = [
|
|
1255
1224
|
"bitflags",
|
|
1256
1225
|
"cssparser",
|
|
@@ -1328,9 +1297,9 @@ dependencies = [
|
|
|
1328
1297
|
|
|
1329
1298
|
[[package]]
|
|
1330
1299
|
name = "servo_arc"
|
|
1331
|
-
version = "0.4.
|
|
1300
|
+
version = "0.4.3"
|
|
1332
1301
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1333
|
-
checksum = "
|
|
1302
|
+
checksum = "170fb83ab34de17dc69aa7c67482b22218ddb85da56546f9bd6b929e32a05930"
|
|
1334
1303
|
dependencies = [
|
|
1335
1304
|
"stable_deref_trait",
|
|
1336
1305
|
]
|
|
@@ -1383,9 +1352,9 @@ checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596"
|
|
|
1383
1352
|
|
|
1384
1353
|
[[package]]
|
|
1385
1354
|
name = "string_cache"
|
|
1386
|
-
version = "0.
|
|
1355
|
+
version = "0.9.0"
|
|
1387
1356
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1388
|
-
checksum = "
|
|
1357
|
+
checksum = "a18596f8c785a729f2819c0f6a7eae6ebeebdfffbfe4214ae6b087f690e31901"
|
|
1389
1358
|
dependencies = [
|
|
1390
1359
|
"new_debug_unreachable",
|
|
1391
1360
|
"parking_lot",
|
|
@@ -1396,9 +1365,9 @@ dependencies = [
|
|
|
1396
1365
|
|
|
1397
1366
|
[[package]]
|
|
1398
1367
|
name = "string_cache_codegen"
|
|
1399
|
-
version = "0.
|
|
1368
|
+
version = "0.6.1"
|
|
1400
1369
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1401
|
-
checksum = "
|
|
1370
|
+
checksum = "585635e46db231059f76c5849798146164652513eb9e8ab2685939dd90f29b69"
|
|
1402
1371
|
dependencies = [
|
|
1403
1372
|
"phf_generator",
|
|
1404
1373
|
"phf_shared",
|
|
@@ -1733,9 +1702,9 @@ dependencies = [
|
|
|
1733
1702
|
|
|
1734
1703
|
[[package]]
|
|
1735
1704
|
name = "web_atoms"
|
|
1736
|
-
version = "0.
|
|
1705
|
+
version = "0.2.0"
|
|
1737
1706
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1738
|
-
checksum = "
|
|
1707
|
+
checksum = "acd0c322f146d0f8aad130ce6c187953889359584497dac6561204c8e17bb43d"
|
|
1739
1708
|
dependencies = [
|
|
1740
1709
|
"phf",
|
|
1741
1710
|
"phf_codegen",
|
data/README.md
CHANGED
|
@@ -142,6 +142,7 @@ inliner.inline("...")
|
|
|
142
142
|
- `cache`. Specifies caching options for external stylesheets (for example, `StylesheetCache(size: 5)`). Default: `nil`
|
|
143
143
|
- `extra_css`. Extra CSS to be inlined. Default: `nil`
|
|
144
144
|
- `preallocate_node_capacity`. **Advanced**. Preallocates capacity for HTML nodes during parsing. This can improve performance when you have an estimate of the number of nodes in your HTML document. Default: `32`
|
|
145
|
+
- `remove_inlined_selectors`. Specifies whether to remove selectors that were successfully inlined from `<style>` blocks. Default: `false`
|
|
145
146
|
|
|
146
147
|
You can also skip CSS inlining for an HTML tag by adding the `data-css-inline="ignore"` attribute to it:
|
|
147
148
|
|
|
@@ -239,15 +240,15 @@ Performance benchmarks show 50-100x faster execution than `roadie` and `premaile
|
|
|
239
240
|
|
|
240
241
|
The table below shows benchmark results comparing `css_inline`, `roadie`, and `premailer` on typical HTML documents:
|
|
241
242
|
|
|
242
|
-
| | Size | `css_inline 0.
|
|
243
|
-
|
|
244
|
-
| Basic usage | 230 B | 6.
|
|
245
|
-
| Realistic email 1 | 8.58 KB |
|
|
246
|
-
| Realistic email 2 | 4.3 KB |
|
|
247
|
-
| GitHub Page | 1.81 MB |
|
|
243
|
+
| | Size | `css_inline 0.19.0` | `roadie 5.2.1` | `premailer 1.21.0` |
|
|
244
|
+
|-------------------|---------|---------------------|-------------------------|-------------------------|
|
|
245
|
+
| Basic usage | 230 B | 6.07 µs | 173.50 µs (**28.60x**) | 345.30 µs (**56.91x**) |
|
|
246
|
+
| Realistic email 1 | 8.58 KB | 91.23 µs | 713.40 µs (**7.82x**) | 6.80 ms (**74.53x**) |
|
|
247
|
+
| Realistic email 2 | 4.3 KB | 57.56 µs | 1.99 ms (**34.56x**) | ERROR |
|
|
248
|
+
| GitHub Page | 1.81 MB | 39.15 ms | 8.20 s (**208.62x**) | 2.40 s (**61.29x**) |
|
|
248
249
|
|
|
249
250
|
Please refer to the `test/bench.rb` file to review the benchmark code.
|
|
250
|
-
The results displayed above were measured using stable `rustc 1.
|
|
251
|
+
The results displayed above were measured using stable `rustc 1.91` on Ruby `3.4.7`.
|
|
251
252
|
|
|
252
253
|
## Further reading
|
|
253
254
|
|
data/ext/css_inline/Cargo.lock
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# This file is automatically @generated by Cargo.
|
|
2
2
|
# It is not intended for manual editing.
|
|
3
|
-
version =
|
|
3
|
+
version = 4
|
|
4
4
|
|
|
5
5
|
[[package]]
|
|
6
6
|
name = "aho-corasick"
|
|
@@ -136,13 +136,12 @@ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
|
|
|
136
136
|
|
|
137
137
|
[[package]]
|
|
138
138
|
name = "css-inline"
|
|
139
|
-
version = "0.
|
|
139
|
+
version = "0.19.0"
|
|
140
140
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
141
|
-
checksum = "
|
|
141
|
+
checksum = "2a6803e80ade2d53b280935cbaf6f124c38c26aeb6cae3c276123bdd13aeb3a8"
|
|
142
142
|
dependencies = [
|
|
143
143
|
"cssparser",
|
|
144
144
|
"html5ever",
|
|
145
|
-
"indexmap",
|
|
146
145
|
"lru",
|
|
147
146
|
"precomputed-hash",
|
|
148
147
|
"reqwest",
|
|
@@ -163,9 +162,9 @@ dependencies = [
|
|
|
163
162
|
|
|
164
163
|
[[package]]
|
|
165
164
|
name = "cssparser"
|
|
166
|
-
version = "0.
|
|
165
|
+
version = "0.36.0"
|
|
167
166
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
168
|
-
checksum = "
|
|
167
|
+
checksum = "dae61cf9c0abb83bd659dab65b7e4e38d8236824c85f0f804f173567bda257d2"
|
|
169
168
|
dependencies = [
|
|
170
169
|
"cssparser-macros",
|
|
171
170
|
"dtoa-short",
|
|
@@ -242,6 +241,12 @@ version = "1.0.2"
|
|
|
242
241
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
243
242
|
checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
|
|
244
243
|
|
|
244
|
+
[[package]]
|
|
245
|
+
name = "fastrand"
|
|
246
|
+
version = "2.3.0"
|
|
247
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
248
|
+
checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
|
|
249
|
+
|
|
245
250
|
[[package]]
|
|
246
251
|
name = "find-msvc-tools"
|
|
247
252
|
version = "0.1.4"
|
|
@@ -375,13 +380,12 @@ dependencies = [
|
|
|
375
380
|
|
|
376
381
|
[[package]]
|
|
377
382
|
name = "html5ever"
|
|
378
|
-
version = "0.
|
|
383
|
+
version = "0.36.1"
|
|
379
384
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
380
|
-
checksum = "
|
|
385
|
+
checksum = "6452c4751a24e1b99c3260d505eaeee76a050573e61f30ac2c924ddc7236f01e"
|
|
381
386
|
dependencies = [
|
|
382
387
|
"log",
|
|
383
388
|
"markup5ever",
|
|
384
|
-
"match_token",
|
|
385
389
|
]
|
|
386
390
|
|
|
387
391
|
[[package]]
|
|
@@ -588,16 +592,6 @@ dependencies = [
|
|
|
588
592
|
"icu_properties",
|
|
589
593
|
]
|
|
590
594
|
|
|
591
|
-
[[package]]
|
|
592
|
-
name = "indexmap"
|
|
593
|
-
version = "2.12.0"
|
|
594
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
595
|
-
checksum = "6717a8d2a5a929a1a2eb43a12812498ed141a0bcfb7e8f7844fbdbe4303bba9f"
|
|
596
|
-
dependencies = [
|
|
597
|
-
"equivalent",
|
|
598
|
-
"hashbrown",
|
|
599
|
-
]
|
|
600
|
-
|
|
601
595
|
[[package]]
|
|
602
596
|
name = "ipnet"
|
|
603
597
|
version = "2.11.0"
|
|
@@ -734,26 +728,15 @@ dependencies = [
|
|
|
734
728
|
|
|
735
729
|
[[package]]
|
|
736
730
|
name = "markup5ever"
|
|
737
|
-
version = "0.
|
|
731
|
+
version = "0.36.1"
|
|
738
732
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
739
|
-
checksum = "
|
|
733
|
+
checksum = "6c3294c4d74d0742910f8c7b466f44dda9eb2d5742c1e430138df290a1e8451c"
|
|
740
734
|
dependencies = [
|
|
741
735
|
"log",
|
|
742
736
|
"tendril",
|
|
743
737
|
"web_atoms",
|
|
744
738
|
]
|
|
745
739
|
|
|
746
|
-
[[package]]
|
|
747
|
-
name = "match_token"
|
|
748
|
-
version = "0.35.0"
|
|
749
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
750
|
-
checksum = "ac84fd3f360fcc43dc5f5d186f02a94192761a080e8bc58621ad4d12296a58cf"
|
|
751
|
-
dependencies = [
|
|
752
|
-
"proc-macro2",
|
|
753
|
-
"quote",
|
|
754
|
-
"syn",
|
|
755
|
-
]
|
|
756
|
-
|
|
757
740
|
[[package]]
|
|
758
741
|
name = "memchr"
|
|
759
742
|
version = "2.7.6"
|
|
@@ -830,19 +813,20 @@ checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
|
|
|
830
813
|
|
|
831
814
|
[[package]]
|
|
832
815
|
name = "phf"
|
|
833
|
-
version = "0.
|
|
816
|
+
version = "0.13.1"
|
|
834
817
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
835
|
-
checksum = "
|
|
818
|
+
checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf"
|
|
836
819
|
dependencies = [
|
|
837
820
|
"phf_macros",
|
|
838
821
|
"phf_shared",
|
|
822
|
+
"serde",
|
|
839
823
|
]
|
|
840
824
|
|
|
841
825
|
[[package]]
|
|
842
826
|
name = "phf_codegen"
|
|
843
|
-
version = "0.
|
|
827
|
+
version = "0.13.1"
|
|
844
828
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
845
|
-
checksum = "
|
|
829
|
+
checksum = "49aa7f9d80421bca176ca8dbfebe668cc7a2684708594ec9f3c0db0805d5d6e1"
|
|
846
830
|
dependencies = [
|
|
847
831
|
"phf_generator",
|
|
848
832
|
"phf_shared",
|
|
@@ -850,19 +834,19 @@ dependencies = [
|
|
|
850
834
|
|
|
851
835
|
[[package]]
|
|
852
836
|
name = "phf_generator"
|
|
853
|
-
version = "0.
|
|
837
|
+
version = "0.13.1"
|
|
854
838
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
855
|
-
checksum = "
|
|
839
|
+
checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737"
|
|
856
840
|
dependencies = [
|
|
841
|
+
"fastrand",
|
|
857
842
|
"phf_shared",
|
|
858
|
-
"rand 0.8.5",
|
|
859
843
|
]
|
|
860
844
|
|
|
861
845
|
[[package]]
|
|
862
846
|
name = "phf_macros"
|
|
863
|
-
version = "0.
|
|
847
|
+
version = "0.13.1"
|
|
864
848
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
865
|
-
checksum = "
|
|
849
|
+
checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef"
|
|
866
850
|
dependencies = [
|
|
867
851
|
"phf_generator",
|
|
868
852
|
"phf_shared",
|
|
@@ -873,9 +857,9 @@ dependencies = [
|
|
|
873
857
|
|
|
874
858
|
[[package]]
|
|
875
859
|
name = "phf_shared"
|
|
876
|
-
version = "0.
|
|
860
|
+
version = "0.13.1"
|
|
877
861
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
878
|
-
checksum = "
|
|
862
|
+
checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266"
|
|
879
863
|
dependencies = [
|
|
880
864
|
"siphasher",
|
|
881
865
|
]
|
|
@@ -954,7 +938,7 @@ dependencies = [
|
|
|
954
938
|
"bytes",
|
|
955
939
|
"getrandom 0.3.4",
|
|
956
940
|
"lru-slab",
|
|
957
|
-
"rand
|
|
941
|
+
"rand",
|
|
958
942
|
"ring",
|
|
959
943
|
"rustc-hash 2.1.1",
|
|
960
944
|
"rustls",
|
|
@@ -995,15 +979,6 @@ version = "5.3.0"
|
|
|
995
979
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
996
980
|
checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
|
|
997
981
|
|
|
998
|
-
[[package]]
|
|
999
|
-
name = "rand"
|
|
1000
|
-
version = "0.8.5"
|
|
1001
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1002
|
-
checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
|
|
1003
|
-
dependencies = [
|
|
1004
|
-
"rand_core 0.6.4",
|
|
1005
|
-
]
|
|
1006
|
-
|
|
1007
982
|
[[package]]
|
|
1008
983
|
name = "rand"
|
|
1009
984
|
version = "0.9.2"
|
|
@@ -1011,7 +986,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
1011
986
|
checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1"
|
|
1012
987
|
dependencies = [
|
|
1013
988
|
"rand_chacha",
|
|
1014
|
-
"rand_core
|
|
989
|
+
"rand_core",
|
|
1015
990
|
]
|
|
1016
991
|
|
|
1017
992
|
[[package]]
|
|
@@ -1021,15 +996,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
1021
996
|
checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb"
|
|
1022
997
|
dependencies = [
|
|
1023
998
|
"ppv-lite86",
|
|
1024
|
-
"rand_core
|
|
999
|
+
"rand_core",
|
|
1025
1000
|
]
|
|
1026
1001
|
|
|
1027
|
-
[[package]]
|
|
1028
|
-
name = "rand_core"
|
|
1029
|
-
version = "0.6.4"
|
|
1030
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1031
|
-
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
|
|
1032
|
-
|
|
1033
1002
|
[[package]]
|
|
1034
1003
|
name = "rand_core"
|
|
1035
1004
|
version = "0.9.3"
|
|
@@ -1248,9 +1217,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
|
|
|
1248
1217
|
|
|
1249
1218
|
[[package]]
|
|
1250
1219
|
name = "selectors"
|
|
1251
|
-
version = "0.
|
|
1220
|
+
version = "0.33.0"
|
|
1252
1221
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1253
|
-
checksum = "
|
|
1222
|
+
checksum = "feef350c36147532e1b79ea5c1f3791373e61cbd9a6a2615413b3807bb164fb7"
|
|
1254
1223
|
dependencies = [
|
|
1255
1224
|
"bitflags",
|
|
1256
1225
|
"cssparser",
|
|
@@ -1328,9 +1297,9 @@ dependencies = [
|
|
|
1328
1297
|
|
|
1329
1298
|
[[package]]
|
|
1330
1299
|
name = "servo_arc"
|
|
1331
|
-
version = "0.4.
|
|
1300
|
+
version = "0.4.3"
|
|
1332
1301
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1333
|
-
checksum = "
|
|
1302
|
+
checksum = "170fb83ab34de17dc69aa7c67482b22218ddb85da56546f9bd6b929e32a05930"
|
|
1334
1303
|
dependencies = [
|
|
1335
1304
|
"stable_deref_trait",
|
|
1336
1305
|
]
|
|
@@ -1383,9 +1352,9 @@ checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596"
|
|
|
1383
1352
|
|
|
1384
1353
|
[[package]]
|
|
1385
1354
|
name = "string_cache"
|
|
1386
|
-
version = "0.
|
|
1355
|
+
version = "0.9.0"
|
|
1387
1356
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1388
|
-
checksum = "
|
|
1357
|
+
checksum = "a18596f8c785a729f2819c0f6a7eae6ebeebdfffbfe4214ae6b087f690e31901"
|
|
1389
1358
|
dependencies = [
|
|
1390
1359
|
"new_debug_unreachable",
|
|
1391
1360
|
"parking_lot",
|
|
@@ -1396,9 +1365,9 @@ dependencies = [
|
|
|
1396
1365
|
|
|
1397
1366
|
[[package]]
|
|
1398
1367
|
name = "string_cache_codegen"
|
|
1399
|
-
version = "0.
|
|
1368
|
+
version = "0.6.1"
|
|
1400
1369
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1401
|
-
checksum = "
|
|
1370
|
+
checksum = "585635e46db231059f76c5849798146164652513eb9e8ab2685939dd90f29b69"
|
|
1402
1371
|
dependencies = [
|
|
1403
1372
|
"phf_generator",
|
|
1404
1373
|
"phf_shared",
|
|
@@ -1733,9 +1702,9 @@ dependencies = [
|
|
|
1733
1702
|
|
|
1734
1703
|
[[package]]
|
|
1735
1704
|
name = "web_atoms"
|
|
1736
|
-
version = "0.
|
|
1705
|
+
version = "0.2.0"
|
|
1737
1706
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1738
|
-
checksum = "
|
|
1707
|
+
checksum = "acd0c322f146d0f8aad130ce6c187953889359584497dac6561204c8e17bb43d"
|
|
1739
1708
|
dependencies = [
|
|
1740
1709
|
"phf",
|
|
1741
1710
|
"phf_codegen",
|
data/ext/css_inline/Cargo.toml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "css-inline-ruby"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.19.0"
|
|
4
4
|
authors = ["Dmitry Dygalo <dmitry@dygalo.dev>"]
|
|
5
|
-
edition = "
|
|
5
|
+
edition = "2024"
|
|
6
6
|
readme = "README.rdoc"
|
|
7
7
|
description = "High-performance library for inlining CSS into HTML 'style' attributes"
|
|
8
8
|
repository = "https://github.com/Stranger6667/css-inline"
|
|
9
9
|
keywords = ["css", "html", "email", "stylesheet", "inlining"]
|
|
10
10
|
categories = ["web-programming"]
|
|
11
11
|
license = "MIT"
|
|
12
|
-
rust-version = "1.
|
|
12
|
+
rust-version = "1.85"
|
|
13
13
|
|
|
14
14
|
[lib]
|
|
15
15
|
name = "css_inline"
|
|
@@ -20,6 +20,6 @@ magnus = "0.8"
|
|
|
20
20
|
rayon = "1"
|
|
21
21
|
|
|
22
22
|
[dependencies.css-inline]
|
|
23
|
-
version = "0.
|
|
23
|
+
version = "0.19.0"
|
|
24
24
|
default-features = false
|
|
25
25
|
features = ["http", "file", "stylesheet-cache"]
|
data/ext/css_inline/src/lib.rs
CHANGED
|
@@ -27,11 +27,10 @@
|
|
|
27
27
|
)]
|
|
28
28
|
use css_inline as rust_inline;
|
|
29
29
|
use magnus::{
|
|
30
|
-
function, method,
|
|
30
|
+
DataTypeFunctions, RHash, Ruby, TryConvert, TypedData, Value, function, method,
|
|
31
31
|
prelude::*,
|
|
32
|
-
scan_args::{get_kwargs, scan_args
|
|
32
|
+
scan_args::{Args, get_kwargs, scan_args},
|
|
33
33
|
typed_data::Obj,
|
|
34
|
-
DataTypeFunctions, RHash, Ruby, TryConvert, TypedData, Value,
|
|
35
34
|
};
|
|
36
35
|
use rayon::prelude::*;
|
|
37
36
|
use std::{
|
|
@@ -68,6 +67,8 @@ struct Options {
|
|
|
68
67
|
/// Pre-allocate capacity for HTML nodes during parsing.
|
|
69
68
|
/// It can improve performance when you have an estimate of the number of nodes in your HTML document.
|
|
70
69
|
preallocate_node_capacity: Option<usize>,
|
|
70
|
+
/// Remove selectors that were successfully inlined from inline `<style>` blocks.
|
|
71
|
+
remove_inlined_selectors: Option<bool>,
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
impl TryConvert for Options {
|
|
@@ -87,6 +88,8 @@ impl TryConvert for Options {
|
|
|
87
88
|
extra_css: h.aref::<_, Option<String>>(ruby.to_symbol("extra_css"))?,
|
|
88
89
|
preallocate_node_capacity: h
|
|
89
90
|
.aref::<_, Option<usize>>(ruby.to_symbol("preallocate_node_capacity"))?,
|
|
91
|
+
remove_inlined_selectors: h
|
|
92
|
+
.aref::<_, Option<bool>>(ruby.to_symbol("remove_inlined_selectors"))?,
|
|
90
93
|
})
|
|
91
94
|
}
|
|
92
95
|
}
|
|
@@ -109,6 +112,7 @@ fn parse_options<Req>(
|
|
|
109
112
|
extra_css: kwargs.extra_css.map(Cow::Owned),
|
|
110
113
|
preallocate_node_capacity: kwargs.preallocate_node_capacity.unwrap_or(32),
|
|
111
114
|
resolver: Arc::new(rust_inline::DefaultStylesheetResolver),
|
|
115
|
+
remove_inlined_selectors: kwargs.remove_inlined_selectors.unwrap_or(false),
|
|
112
116
|
})
|
|
113
117
|
}
|
|
114
118
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: css_inline
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.19.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dmitry Dygalo
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-
|
|
11
|
+
date: 2025-12-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rb_sys
|
|
@@ -38,62 +38,6 @@ dependencies:
|
|
|
38
38
|
- - "~>"
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
40
|
version: 1.3.0
|
|
41
|
-
- !ruby/object:Gem::Dependency
|
|
42
|
-
name: benchmark-ips
|
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
|
44
|
-
requirements:
|
|
45
|
-
- - "~>"
|
|
46
|
-
- !ruby/object:Gem::Version
|
|
47
|
-
version: '2.10'
|
|
48
|
-
type: :development
|
|
49
|
-
prerelease: false
|
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
-
requirements:
|
|
52
|
-
- - "~>"
|
|
53
|
-
- !ruby/object:Gem::Version
|
|
54
|
-
version: '2.10'
|
|
55
|
-
- !ruby/object:Gem::Dependency
|
|
56
|
-
name: premailer
|
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
|
58
|
-
requirements:
|
|
59
|
-
- - "~>"
|
|
60
|
-
- !ruby/object:Gem::Version
|
|
61
|
-
version: '1.21'
|
|
62
|
-
type: :development
|
|
63
|
-
prerelease: false
|
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
-
requirements:
|
|
66
|
-
- - "~>"
|
|
67
|
-
- !ruby/object:Gem::Version
|
|
68
|
-
version: '1.21'
|
|
69
|
-
- !ruby/object:Gem::Dependency
|
|
70
|
-
name: roadie
|
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
|
72
|
-
requirements:
|
|
73
|
-
- - "~>"
|
|
74
|
-
- !ruby/object:Gem::Version
|
|
75
|
-
version: 5.2.1
|
|
76
|
-
type: :development
|
|
77
|
-
prerelease: false
|
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
-
requirements:
|
|
80
|
-
- - "~>"
|
|
81
|
-
- !ruby/object:Gem::Version
|
|
82
|
-
version: 5.2.1
|
|
83
|
-
- !ruby/object:Gem::Dependency
|
|
84
|
-
name: nokogiri
|
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
|
86
|
-
requirements:
|
|
87
|
-
- - "~>"
|
|
88
|
-
- !ruby/object:Gem::Version
|
|
89
|
-
version: '1.15'
|
|
90
|
-
type: :development
|
|
91
|
-
prerelease: false
|
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
-
requirements:
|
|
94
|
-
- - "~>"
|
|
95
|
-
- !ruby/object:Gem::Version
|
|
96
|
-
version: '1.15'
|
|
97
41
|
description: |2
|
|
98
42
|
`css_inline` inlines CSS into HTML documents, using components from Mozilla's Servo project.
|
|
99
43
|
This process is essential for sending HTML emails as you need to use "style" attributes instead of "style" tags.
|