css_inline 0.15.2 → 0.17.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 +83 -52
- data/README.md +26 -11
- data/ext/css_inline/Cargo.lock +83 -52
- data/ext/css_inline/Cargo.toml +2 -2
- data/ext/css_inline/src/lib.rs +8 -5
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06e08f4bb917762d72e83081759790fadc9f9226d33d19473e031ee28bf38340
|
4
|
+
data.tar.gz: 00b5d9ab4eacfe837b11df8aa7cb083133ace0746491c247c1a9b573ecf1c811
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bad62adc1995b9e140b9fb2e8604c399ef2699b2ce9baa67da26b484672fd5f7b9b45e55e612b5ba41019a0b13a7d67c187569339d6691c9d69248888f098020
|
7
|
+
data.tar.gz: 31b579aa33316051d4e180b00297c404efbab38e6d1a0d8ffb4600306e292d9400424740dbbcd3c891bcb090c4077b75deb811ebadb8e12a536b128e7f927a5b
|
data/Cargo.lock
CHANGED
@@ -105,9 +105,9 @@ checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a"
|
|
105
105
|
|
106
106
|
[[package]]
|
107
107
|
name = "cc"
|
108
|
-
version = "1.2.
|
108
|
+
version = "1.2.30"
|
109
109
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
110
|
-
checksum = "
|
110
|
+
checksum = "deec109607ca693028562ed836a5f1c4b8bd77755c4e132fc5ce11b0b6211ae7"
|
111
111
|
dependencies = [
|
112
112
|
"shlex",
|
113
113
|
]
|
@@ -171,9 +171,18 @@ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
|
|
171
171
|
|
172
172
|
[[package]]
|
173
173
|
name = "css-inline"
|
174
|
-
version = "0.
|
174
|
+
version = "0.17.0"
|
175
|
+
dependencies = [
|
176
|
+
"css-inline 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
177
|
+
"magnus",
|
178
|
+
"rayon",
|
179
|
+
]
|
180
|
+
|
181
|
+
[[package]]
|
182
|
+
name = "css-inline"
|
183
|
+
version = "0.17.0"
|
175
184
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
176
|
-
checksum = "
|
185
|
+
checksum = "30983955a71311b6268dca9ea211b75136367ab3ed7d27d78617587d7d9beebf"
|
177
186
|
dependencies = [
|
178
187
|
"cssparser",
|
179
188
|
"html5ever",
|
@@ -187,15 +196,6 @@ dependencies = [
|
|
187
196
|
"url",
|
188
197
|
]
|
189
198
|
|
190
|
-
[[package]]
|
191
|
-
name = "css-inline"
|
192
|
-
version = "0.15.2"
|
193
|
-
dependencies = [
|
194
|
-
"css-inline 0.15.0",
|
195
|
-
"magnus",
|
196
|
-
"rayon",
|
197
|
-
]
|
198
|
-
|
199
199
|
[[package]]
|
200
200
|
name = "cssparser"
|
201
201
|
version = "0.35.0"
|
@@ -221,9 +221,18 @@ dependencies = [
|
|
221
221
|
|
222
222
|
[[package]]
|
223
223
|
name = "derive_more"
|
224
|
-
version = "0.
|
224
|
+
version = "2.0.1"
|
225
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
226
|
+
checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678"
|
227
|
+
dependencies = [
|
228
|
+
"derive_more-impl",
|
229
|
+
]
|
230
|
+
|
231
|
+
[[package]]
|
232
|
+
name = "derive_more-impl"
|
233
|
+
version = "2.0.1"
|
225
234
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
226
|
-
checksum = "
|
235
|
+
checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3"
|
227
236
|
dependencies = [
|
228
237
|
"proc-macro2",
|
229
238
|
"quote",
|
@@ -410,12 +419,11 @@ dependencies = [
|
|
410
419
|
|
411
420
|
[[package]]
|
412
421
|
name = "html5ever"
|
413
|
-
version = "0.
|
422
|
+
version = "0.35.0"
|
414
423
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
415
|
-
checksum = "
|
424
|
+
checksum = "55d958c2f74b664487a2035fe1dadb032c48718a03b63f3ab0b8537db8549ed4"
|
416
425
|
dependencies = [
|
417
426
|
"log",
|
418
|
-
"mac",
|
419
427
|
"markup5ever",
|
420
428
|
"match_token",
|
421
429
|
]
|
@@ -498,9 +506,9 @@ dependencies = [
|
|
498
506
|
|
499
507
|
[[package]]
|
500
508
|
name = "hyper-util"
|
501
|
-
version = "0.1.
|
509
|
+
version = "0.1.16"
|
502
510
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
503
|
-
checksum = "
|
511
|
+
checksum = "8d9b05277c7e8da2c93a568989bb6207bef0112e8d17df7a6eda4a3cf143bc5e"
|
504
512
|
dependencies = [
|
505
513
|
"base64",
|
506
514
|
"bytes",
|
@@ -514,7 +522,7 @@ dependencies = [
|
|
514
522
|
"libc",
|
515
523
|
"percent-encoding",
|
516
524
|
"pin-project-lite",
|
517
|
-
"socket2",
|
525
|
+
"socket2 0.6.0",
|
518
526
|
"tokio",
|
519
527
|
"tower-service",
|
520
528
|
"tracing",
|
@@ -629,14 +637,25 @@ dependencies = [
|
|
629
637
|
|
630
638
|
[[package]]
|
631
639
|
name = "indexmap"
|
632
|
-
version = "2.
|
640
|
+
version = "2.10.0"
|
633
641
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
634
|
-
checksum = "
|
642
|
+
checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661"
|
635
643
|
dependencies = [
|
636
644
|
"equivalent",
|
637
645
|
"hashbrown",
|
638
646
|
]
|
639
647
|
|
648
|
+
[[package]]
|
649
|
+
name = "io-uring"
|
650
|
+
version = "0.7.9"
|
651
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
652
|
+
checksum = "d93587f37623a1a17d94ef2bc9ada592f5465fe7732084ab7beefabe5c77c0c4"
|
653
|
+
dependencies = [
|
654
|
+
"bitflags",
|
655
|
+
"cfg-if",
|
656
|
+
"libc",
|
657
|
+
]
|
658
|
+
|
640
659
|
[[package]]
|
641
660
|
name = "ipnet"
|
642
661
|
version = "2.11.0"
|
@@ -730,9 +749,9 @@ checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94"
|
|
730
749
|
|
731
750
|
[[package]]
|
732
751
|
name = "lru"
|
733
|
-
version = "0.
|
752
|
+
version = "0.16.0"
|
734
753
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
735
|
-
checksum = "
|
754
|
+
checksum = "86ea4e65087ff52f3862caff188d489f1fab49a0cb09e01b2e3f1a617b10aaed"
|
736
755
|
dependencies = [
|
737
756
|
"hashbrown",
|
738
757
|
]
|
@@ -774,9 +793,9 @@ dependencies = [
|
|
774
793
|
|
775
794
|
[[package]]
|
776
795
|
name = "markup5ever"
|
777
|
-
version = "0.
|
796
|
+
version = "0.35.0"
|
778
797
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
779
|
-
checksum = "
|
798
|
+
checksum = "311fe69c934650f8f19652b3946075f0fc41ad8757dbb68f1ca14e7900ecc1c3"
|
780
799
|
dependencies = [
|
781
800
|
"log",
|
782
801
|
"tendril",
|
@@ -785,9 +804,9 @@ dependencies = [
|
|
785
804
|
|
786
805
|
[[package]]
|
787
806
|
name = "match_token"
|
788
|
-
version = "0.
|
807
|
+
version = "0.35.0"
|
789
808
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
790
|
-
checksum = "
|
809
|
+
checksum = "ac84fd3f360fcc43dc5f5d186f02a94192761a080e8bc58621ad4d12296a58cf"
|
791
810
|
dependencies = [
|
792
811
|
"proc-macro2",
|
793
812
|
"quote",
|
@@ -996,7 +1015,7 @@ dependencies = [
|
|
996
1015
|
"quinn-udp",
|
997
1016
|
"rustc-hash 2.1.1",
|
998
1017
|
"rustls",
|
999
|
-
"socket2",
|
1018
|
+
"socket2 0.5.10",
|
1000
1019
|
"thiserror",
|
1001
1020
|
"tokio",
|
1002
1021
|
"tracing",
|
@@ -1012,7 +1031,7 @@ dependencies = [
|
|
1012
1031
|
"bytes",
|
1013
1032
|
"getrandom 0.3.3",
|
1014
1033
|
"lru-slab",
|
1015
|
-
"rand 0.9.
|
1034
|
+
"rand 0.9.2",
|
1016
1035
|
"ring",
|
1017
1036
|
"rustc-hash 2.1.1",
|
1018
1037
|
"rustls",
|
@@ -1033,7 +1052,7 @@ dependencies = [
|
|
1033
1052
|
"cfg_aliases",
|
1034
1053
|
"libc",
|
1035
1054
|
"once_cell",
|
1036
|
-
"socket2",
|
1055
|
+
"socket2 0.5.10",
|
1037
1056
|
"tracing",
|
1038
1057
|
"windows-sys 0.59.0",
|
1039
1058
|
]
|
@@ -1064,9 +1083,9 @@ dependencies = [
|
|
1064
1083
|
|
1065
1084
|
[[package]]
|
1066
1085
|
name = "rand"
|
1067
|
-
version = "0.9.
|
1086
|
+
version = "0.9.2"
|
1068
1087
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1069
|
-
checksum = "
|
1088
|
+
checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1"
|
1070
1089
|
dependencies = [
|
1071
1090
|
"rand_chacha",
|
1072
1091
|
"rand_core 0.9.3",
|
@@ -1149,9 +1168,9 @@ checksum = "a35802679f07360454b418a5d1735c89716bde01d35b1560fc953c1415a0b3bb"
|
|
1149
1168
|
|
1150
1169
|
[[package]]
|
1151
1170
|
name = "redox_syscall"
|
1152
|
-
version = "0.5.
|
1171
|
+
version = "0.5.16"
|
1153
1172
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1154
|
-
checksum = "
|
1173
|
+
checksum = "7251471db004e509f4e75a62cca9435365b5ec7bcdff530d612ac7c87c44a792"
|
1155
1174
|
dependencies = [
|
1156
1175
|
"bitflags",
|
1157
1176
|
]
|
@@ -1187,9 +1206,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
|
|
1187
1206
|
|
1188
1207
|
[[package]]
|
1189
1208
|
name = "reqwest"
|
1190
|
-
version = "0.12.
|
1209
|
+
version = "0.12.22"
|
1191
1210
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1192
|
-
checksum = "
|
1211
|
+
checksum = "cbc931937e6ca3a06e3b6c0aa7841849b160a90351d6ab467a8b9b9959767531"
|
1193
1212
|
dependencies = [
|
1194
1213
|
"base64",
|
1195
1214
|
"bytes",
|
@@ -1259,9 +1278,9 @@ checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
|
|
1259
1278
|
|
1260
1279
|
[[package]]
|
1261
1280
|
name = "rustls"
|
1262
|
-
version = "0.23.
|
1281
|
+
version = "0.23.29"
|
1263
1282
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1264
|
-
checksum = "
|
1283
|
+
checksum = "2491382039b29b9b11ff08b76ff6c97cf287671dbb74f0be44bda389fffe9bd1"
|
1265
1284
|
dependencies = [
|
1266
1285
|
"once_cell",
|
1267
1286
|
"ring",
|
@@ -1283,9 +1302,9 @@ dependencies = [
|
|
1283
1302
|
|
1284
1303
|
[[package]]
|
1285
1304
|
name = "rustls-webpki"
|
1286
|
-
version = "0.103.
|
1305
|
+
version = "0.103.4"
|
1287
1306
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1288
|
-
checksum = "
|
1307
|
+
checksum = "0a17884ae0c1b773f1ccd2bd4a8c72f16da897310a98b0e84bf349ad5ead92fc"
|
1289
1308
|
dependencies = [
|
1290
1309
|
"ring",
|
1291
1310
|
"rustls-pki-types",
|
@@ -1312,9 +1331,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
|
|
1312
1331
|
|
1313
1332
|
[[package]]
|
1314
1333
|
name = "selectors"
|
1315
|
-
version = "0.
|
1334
|
+
version = "0.30.0"
|
1316
1335
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1317
|
-
checksum = "
|
1336
|
+
checksum = "3df44ba8a7ca7a4d28c589e04f526266ed76b6cc556e33fe69fa25de31939a65"
|
1318
1337
|
dependencies = [
|
1319
1338
|
"bitflags",
|
1320
1339
|
"cssparser",
|
@@ -1357,9 +1376,9 @@ dependencies = [
|
|
1357
1376
|
|
1358
1377
|
[[package]]
|
1359
1378
|
name = "serde_json"
|
1360
|
-
version = "1.0.
|
1379
|
+
version = "1.0.141"
|
1361
1380
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1362
|
-
checksum = "
|
1381
|
+
checksum = "30b9eff21ebe718216c6ec64e1d9ac57087aad11efc64e32002bce4a0d4c03d3"
|
1363
1382
|
dependencies = [
|
1364
1383
|
"itoa",
|
1365
1384
|
"memchr",
|
@@ -1428,6 +1447,16 @@ dependencies = [
|
|
1428
1447
|
"windows-sys 0.52.0",
|
1429
1448
|
]
|
1430
1449
|
|
1450
|
+
[[package]]
|
1451
|
+
name = "socket2"
|
1452
|
+
version = "0.6.0"
|
1453
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1454
|
+
checksum = "233504af464074f9d066d7b5416c5f9b894a5862a6506e306f7b816cdd6f1807"
|
1455
|
+
dependencies = [
|
1456
|
+
"libc",
|
1457
|
+
"windows-sys 0.59.0",
|
1458
|
+
]
|
1459
|
+
|
1431
1460
|
[[package]]
|
1432
1461
|
name = "stable_deref_trait"
|
1433
1462
|
version = "1.2.0"
|
@@ -1554,17 +1583,19 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
|
|
1554
1583
|
|
1555
1584
|
[[package]]
|
1556
1585
|
name = "tokio"
|
1557
|
-
version = "1.
|
1586
|
+
version = "1.47.0"
|
1558
1587
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1559
|
-
checksum = "
|
1588
|
+
checksum = "43864ed400b6043a4757a25c7a64a8efde741aed79a056a2fb348a406701bb35"
|
1560
1589
|
dependencies = [
|
1561
1590
|
"backtrace",
|
1562
1591
|
"bytes",
|
1592
|
+
"io-uring",
|
1563
1593
|
"libc",
|
1564
1594
|
"mio",
|
1565
1595
|
"pin-project-lite",
|
1566
|
-
"
|
1567
|
-
"
|
1596
|
+
"slab",
|
1597
|
+
"socket2 0.6.0",
|
1598
|
+
"windows-sys 0.59.0",
|
1568
1599
|
]
|
1569
1600
|
|
1570
1601
|
[[package]]
|
@@ -1811,9 +1842,9 @@ dependencies = [
|
|
1811
1842
|
|
1812
1843
|
[[package]]
|
1813
1844
|
name = "webpki-roots"
|
1814
|
-
version = "1.0.
|
1845
|
+
version = "1.0.2"
|
1815
1846
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1816
|
-
checksum = "
|
1847
|
+
checksum = "7e8983c3ab33d6fb807cfcdad2491c4ea8cbc8ed839181c7dfd9c67c83e261b2"
|
1817
1848
|
dependencies = [
|
1818
1849
|
"rustls-pki-types",
|
1819
1850
|
]
|
data/README.md
CHANGED
@@ -135,6 +135,7 @@ inliner.inline("...")
|
|
135
135
|
- `inline_style_tags`. Specifies whether to inline CSS from "style" tags. Default: `true`
|
136
136
|
- `keep_style_tags`. Specifies whether to keep "style" tags after inlining. Default: `false`
|
137
137
|
- `keep_link_tags`. Specifies whether to keep "link" tags after inlining. Default: `false`
|
138
|
+
- `keep_at_rules`. Specifies whether to keep "at-rules" (starting with `@`) after inlining. Default: `false`
|
138
139
|
- `base_url`. The base URL used to resolve relative URLs. If you'd like to load stylesheets from your filesystem, use the `file://` scheme. Default: `nil`
|
139
140
|
- `load_remote_stylesheets`. Specifies whether remote stylesheets should be loaded. Default: `true`
|
140
141
|
- `cache`. Specifies caching options for external stylesheets (for example, `StylesheetCache(size: 5)`). Default: `nil`
|
@@ -166,7 +167,8 @@ The `data-css-inline="ignore"` attribute also allows you to skip `link` and `sty
|
|
166
167
|
```
|
167
168
|
|
168
169
|
Alternatively, you may keep `style` from being removed by using the `data-css-inline="keep"` attribute.
|
169
|
-
This is useful if you want to keep `@media` queries for responsive emails in separate `style` tags
|
170
|
+
This is useful if you want to keep `@media` queries for responsive emails in separate `style` tags.
|
171
|
+
Such tags will be kept in the resulting HTML even if the `keep_style_tags` option is set to `false`.
|
170
172
|
|
171
173
|
```html
|
172
174
|
<head>
|
@@ -178,7 +180,20 @@ This is useful if you want to keep `@media` queries for responsive emails in sep
|
|
178
180
|
</body>
|
179
181
|
```
|
180
182
|
|
181
|
-
|
183
|
+
Another possibility is to set `keep_at_rules` option to `true`. At-rules cannot be inlined into HTML therefore they
|
184
|
+
get removed by default. This is useful if you want to keep at-rules, e.g. `@media` queries for responsive emails in
|
185
|
+
separate `style` tags but inline any styles which can be inlined.
|
186
|
+
Such tags will be kept in the resulting HTML even if the `keep_style_tags` option is explicitly set to `false`.
|
187
|
+
|
188
|
+
```html
|
189
|
+
<head>
|
190
|
+
<!-- With keep_at_rules=true "color:blue" will get inlined into <h1> but @media will be kept in <style> -->
|
191
|
+
<style>h1 { color: blue; } @media (max-width: 600px) { h1 { font-size: 18px; } }</style>
|
192
|
+
</head>
|
193
|
+
<body>
|
194
|
+
<h1>Big Text</h1>
|
195
|
+
</body>
|
196
|
+
```
|
182
197
|
|
183
198
|
If you'd like to load stylesheets from your filesystem, use the `file://` scheme:
|
184
199
|
|
@@ -205,17 +220,17 @@ Caching is disabled by default.
|
|
205
220
|
|
206
221
|
## Performance
|
207
222
|
|
208
|
-
|
209
|
-
|
223
|
+
This library uses components from Mozilla's Servo project for CSS parsing and matching.
|
224
|
+
Performance benchmarks show 50-100x faster execution than `roadie` and `premailer`.
|
210
225
|
|
211
|
-
The table below
|
226
|
+
The table below shows benchmark results comparing `css_inline`, `roadie`, and `premailer` on typical HTML documents:
|
212
227
|
|
213
|
-
| | Size | `css_inline 0.15.0` | `
|
214
|
-
|
215
|
-
| Basic usage | 230 B | 6.11 µs | 350.10 µs
|
216
|
-
| Realistic email 1 | 8.58 KB | 101.82 µs | 7.99 ms
|
217
|
-
| Realistic email 2 | 4.3 KB | 77.22 µs
|
218
|
-
| GitHub Page | 1.81 MB | 172.41 ms | 2.77 s
|
228
|
+
| | Size | `css_inline 0.15.0` | `roadie 5.2.1` | `premailer 1.21.0` |
|
229
|
+
|-------------------|---------|---------------------|----------------|---------------------------|
|
230
|
+
| Basic usage | 230 B | 6.11 µs | 175.21 µs (**28.75**) | 350.10 µs (**57.24x**) |
|
231
|
+
| Realistic email 1 | 8.58 KB | 101.82 µs | 721.18 µs (**6.96x**) | 7.99 ms (**78.49x**) |
|
232
|
+
| Realistic email 2 | 4.3 KB | 77.22 µs | 2.02 ms (**28.48x**) | ERROR |
|
233
|
+
| GitHub Page | 1.81 MB | 172.41 ms | 8.84 s (**52.21x**) | 2.77 s (**15.97x**) |
|
219
234
|
|
220
235
|
Please refer to the `test/bench.rb` file to review the benchmark code.
|
221
236
|
The results displayed above were measured using stable `rustc 1.87` on Ruby `3.3.5`.
|
data/ext/css_inline/Cargo.lock
CHANGED
@@ -105,9 +105,9 @@ checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a"
|
|
105
105
|
|
106
106
|
[[package]]
|
107
107
|
name = "cc"
|
108
|
-
version = "1.2.
|
108
|
+
version = "1.2.30"
|
109
109
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
110
|
-
checksum = "
|
110
|
+
checksum = "deec109607ca693028562ed836a5f1c4b8bd77755c4e132fc5ce11b0b6211ae7"
|
111
111
|
dependencies = [
|
112
112
|
"shlex",
|
113
113
|
]
|
@@ -171,9 +171,18 @@ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
|
|
171
171
|
|
172
172
|
[[package]]
|
173
173
|
name = "css-inline"
|
174
|
-
version = "0.
|
174
|
+
version = "0.17.0"
|
175
|
+
dependencies = [
|
176
|
+
"css-inline 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
177
|
+
"magnus",
|
178
|
+
"rayon",
|
179
|
+
]
|
180
|
+
|
181
|
+
[[package]]
|
182
|
+
name = "css-inline"
|
183
|
+
version = "0.17.0"
|
175
184
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
176
|
-
checksum = "
|
185
|
+
checksum = "30983955a71311b6268dca9ea211b75136367ab3ed7d27d78617587d7d9beebf"
|
177
186
|
dependencies = [
|
178
187
|
"cssparser",
|
179
188
|
"html5ever",
|
@@ -187,15 +196,6 @@ dependencies = [
|
|
187
196
|
"url",
|
188
197
|
]
|
189
198
|
|
190
|
-
[[package]]
|
191
|
-
name = "css-inline"
|
192
|
-
version = "0.15.2"
|
193
|
-
dependencies = [
|
194
|
-
"css-inline 0.15.0",
|
195
|
-
"magnus",
|
196
|
-
"rayon",
|
197
|
-
]
|
198
|
-
|
199
199
|
[[package]]
|
200
200
|
name = "cssparser"
|
201
201
|
version = "0.35.0"
|
@@ -221,9 +221,18 @@ dependencies = [
|
|
221
221
|
|
222
222
|
[[package]]
|
223
223
|
name = "derive_more"
|
224
|
-
version = "0.
|
224
|
+
version = "2.0.1"
|
225
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
226
|
+
checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678"
|
227
|
+
dependencies = [
|
228
|
+
"derive_more-impl",
|
229
|
+
]
|
230
|
+
|
231
|
+
[[package]]
|
232
|
+
name = "derive_more-impl"
|
233
|
+
version = "2.0.1"
|
225
234
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
226
|
-
checksum = "
|
235
|
+
checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3"
|
227
236
|
dependencies = [
|
228
237
|
"proc-macro2",
|
229
238
|
"quote",
|
@@ -410,12 +419,11 @@ dependencies = [
|
|
410
419
|
|
411
420
|
[[package]]
|
412
421
|
name = "html5ever"
|
413
|
-
version = "0.
|
422
|
+
version = "0.35.0"
|
414
423
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
415
|
-
checksum = "
|
424
|
+
checksum = "55d958c2f74b664487a2035fe1dadb032c48718a03b63f3ab0b8537db8549ed4"
|
416
425
|
dependencies = [
|
417
426
|
"log",
|
418
|
-
"mac",
|
419
427
|
"markup5ever",
|
420
428
|
"match_token",
|
421
429
|
]
|
@@ -498,9 +506,9 @@ dependencies = [
|
|
498
506
|
|
499
507
|
[[package]]
|
500
508
|
name = "hyper-util"
|
501
|
-
version = "0.1.
|
509
|
+
version = "0.1.16"
|
502
510
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
503
|
-
checksum = "
|
511
|
+
checksum = "8d9b05277c7e8da2c93a568989bb6207bef0112e8d17df7a6eda4a3cf143bc5e"
|
504
512
|
dependencies = [
|
505
513
|
"base64",
|
506
514
|
"bytes",
|
@@ -514,7 +522,7 @@ dependencies = [
|
|
514
522
|
"libc",
|
515
523
|
"percent-encoding",
|
516
524
|
"pin-project-lite",
|
517
|
-
"socket2",
|
525
|
+
"socket2 0.6.0",
|
518
526
|
"tokio",
|
519
527
|
"tower-service",
|
520
528
|
"tracing",
|
@@ -629,14 +637,25 @@ dependencies = [
|
|
629
637
|
|
630
638
|
[[package]]
|
631
639
|
name = "indexmap"
|
632
|
-
version = "2.
|
640
|
+
version = "2.10.0"
|
633
641
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
634
|
-
checksum = "
|
642
|
+
checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661"
|
635
643
|
dependencies = [
|
636
644
|
"equivalent",
|
637
645
|
"hashbrown",
|
638
646
|
]
|
639
647
|
|
648
|
+
[[package]]
|
649
|
+
name = "io-uring"
|
650
|
+
version = "0.7.9"
|
651
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
652
|
+
checksum = "d93587f37623a1a17d94ef2bc9ada592f5465fe7732084ab7beefabe5c77c0c4"
|
653
|
+
dependencies = [
|
654
|
+
"bitflags",
|
655
|
+
"cfg-if",
|
656
|
+
"libc",
|
657
|
+
]
|
658
|
+
|
640
659
|
[[package]]
|
641
660
|
name = "ipnet"
|
642
661
|
version = "2.11.0"
|
@@ -730,9 +749,9 @@ checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94"
|
|
730
749
|
|
731
750
|
[[package]]
|
732
751
|
name = "lru"
|
733
|
-
version = "0.
|
752
|
+
version = "0.16.0"
|
734
753
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
735
|
-
checksum = "
|
754
|
+
checksum = "86ea4e65087ff52f3862caff188d489f1fab49a0cb09e01b2e3f1a617b10aaed"
|
736
755
|
dependencies = [
|
737
756
|
"hashbrown",
|
738
757
|
]
|
@@ -774,9 +793,9 @@ dependencies = [
|
|
774
793
|
|
775
794
|
[[package]]
|
776
795
|
name = "markup5ever"
|
777
|
-
version = "0.
|
796
|
+
version = "0.35.0"
|
778
797
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
779
|
-
checksum = "
|
798
|
+
checksum = "311fe69c934650f8f19652b3946075f0fc41ad8757dbb68f1ca14e7900ecc1c3"
|
780
799
|
dependencies = [
|
781
800
|
"log",
|
782
801
|
"tendril",
|
@@ -785,9 +804,9 @@ dependencies = [
|
|
785
804
|
|
786
805
|
[[package]]
|
787
806
|
name = "match_token"
|
788
|
-
version = "0.
|
807
|
+
version = "0.35.0"
|
789
808
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
790
|
-
checksum = "
|
809
|
+
checksum = "ac84fd3f360fcc43dc5f5d186f02a94192761a080e8bc58621ad4d12296a58cf"
|
791
810
|
dependencies = [
|
792
811
|
"proc-macro2",
|
793
812
|
"quote",
|
@@ -996,7 +1015,7 @@ dependencies = [
|
|
996
1015
|
"quinn-udp",
|
997
1016
|
"rustc-hash 2.1.1",
|
998
1017
|
"rustls",
|
999
|
-
"socket2",
|
1018
|
+
"socket2 0.5.10",
|
1000
1019
|
"thiserror",
|
1001
1020
|
"tokio",
|
1002
1021
|
"tracing",
|
@@ -1012,7 +1031,7 @@ dependencies = [
|
|
1012
1031
|
"bytes",
|
1013
1032
|
"getrandom 0.3.3",
|
1014
1033
|
"lru-slab",
|
1015
|
-
"rand 0.9.
|
1034
|
+
"rand 0.9.2",
|
1016
1035
|
"ring",
|
1017
1036
|
"rustc-hash 2.1.1",
|
1018
1037
|
"rustls",
|
@@ -1033,7 +1052,7 @@ dependencies = [
|
|
1033
1052
|
"cfg_aliases",
|
1034
1053
|
"libc",
|
1035
1054
|
"once_cell",
|
1036
|
-
"socket2",
|
1055
|
+
"socket2 0.5.10",
|
1037
1056
|
"tracing",
|
1038
1057
|
"windows-sys 0.59.0",
|
1039
1058
|
]
|
@@ -1064,9 +1083,9 @@ dependencies = [
|
|
1064
1083
|
|
1065
1084
|
[[package]]
|
1066
1085
|
name = "rand"
|
1067
|
-
version = "0.9.
|
1086
|
+
version = "0.9.2"
|
1068
1087
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1069
|
-
checksum = "
|
1088
|
+
checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1"
|
1070
1089
|
dependencies = [
|
1071
1090
|
"rand_chacha",
|
1072
1091
|
"rand_core 0.9.3",
|
@@ -1149,9 +1168,9 @@ checksum = "a35802679f07360454b418a5d1735c89716bde01d35b1560fc953c1415a0b3bb"
|
|
1149
1168
|
|
1150
1169
|
[[package]]
|
1151
1170
|
name = "redox_syscall"
|
1152
|
-
version = "0.5.
|
1171
|
+
version = "0.5.16"
|
1153
1172
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1154
|
-
checksum = "
|
1173
|
+
checksum = "7251471db004e509f4e75a62cca9435365b5ec7bcdff530d612ac7c87c44a792"
|
1155
1174
|
dependencies = [
|
1156
1175
|
"bitflags",
|
1157
1176
|
]
|
@@ -1187,9 +1206,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
|
|
1187
1206
|
|
1188
1207
|
[[package]]
|
1189
1208
|
name = "reqwest"
|
1190
|
-
version = "0.12.
|
1209
|
+
version = "0.12.22"
|
1191
1210
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1192
|
-
checksum = "
|
1211
|
+
checksum = "cbc931937e6ca3a06e3b6c0aa7841849b160a90351d6ab467a8b9b9959767531"
|
1193
1212
|
dependencies = [
|
1194
1213
|
"base64",
|
1195
1214
|
"bytes",
|
@@ -1259,9 +1278,9 @@ checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
|
|
1259
1278
|
|
1260
1279
|
[[package]]
|
1261
1280
|
name = "rustls"
|
1262
|
-
version = "0.23.
|
1281
|
+
version = "0.23.29"
|
1263
1282
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1264
|
-
checksum = "
|
1283
|
+
checksum = "2491382039b29b9b11ff08b76ff6c97cf287671dbb74f0be44bda389fffe9bd1"
|
1265
1284
|
dependencies = [
|
1266
1285
|
"once_cell",
|
1267
1286
|
"ring",
|
@@ -1283,9 +1302,9 @@ dependencies = [
|
|
1283
1302
|
|
1284
1303
|
[[package]]
|
1285
1304
|
name = "rustls-webpki"
|
1286
|
-
version = "0.103.
|
1305
|
+
version = "0.103.4"
|
1287
1306
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1288
|
-
checksum = "
|
1307
|
+
checksum = "0a17884ae0c1b773f1ccd2bd4a8c72f16da897310a98b0e84bf349ad5ead92fc"
|
1289
1308
|
dependencies = [
|
1290
1309
|
"ring",
|
1291
1310
|
"rustls-pki-types",
|
@@ -1312,9 +1331,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
|
|
1312
1331
|
|
1313
1332
|
[[package]]
|
1314
1333
|
name = "selectors"
|
1315
|
-
version = "0.
|
1334
|
+
version = "0.30.0"
|
1316
1335
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1317
|
-
checksum = "
|
1336
|
+
checksum = "3df44ba8a7ca7a4d28c589e04f526266ed76b6cc556e33fe69fa25de31939a65"
|
1318
1337
|
dependencies = [
|
1319
1338
|
"bitflags",
|
1320
1339
|
"cssparser",
|
@@ -1357,9 +1376,9 @@ dependencies = [
|
|
1357
1376
|
|
1358
1377
|
[[package]]
|
1359
1378
|
name = "serde_json"
|
1360
|
-
version = "1.0.
|
1379
|
+
version = "1.0.141"
|
1361
1380
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1362
|
-
checksum = "
|
1381
|
+
checksum = "30b9eff21ebe718216c6ec64e1d9ac57087aad11efc64e32002bce4a0d4c03d3"
|
1363
1382
|
dependencies = [
|
1364
1383
|
"itoa",
|
1365
1384
|
"memchr",
|
@@ -1428,6 +1447,16 @@ dependencies = [
|
|
1428
1447
|
"windows-sys 0.52.0",
|
1429
1448
|
]
|
1430
1449
|
|
1450
|
+
[[package]]
|
1451
|
+
name = "socket2"
|
1452
|
+
version = "0.6.0"
|
1453
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1454
|
+
checksum = "233504af464074f9d066d7b5416c5f9b894a5862a6506e306f7b816cdd6f1807"
|
1455
|
+
dependencies = [
|
1456
|
+
"libc",
|
1457
|
+
"windows-sys 0.59.0",
|
1458
|
+
]
|
1459
|
+
|
1431
1460
|
[[package]]
|
1432
1461
|
name = "stable_deref_trait"
|
1433
1462
|
version = "1.2.0"
|
@@ -1554,17 +1583,19 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
|
|
1554
1583
|
|
1555
1584
|
[[package]]
|
1556
1585
|
name = "tokio"
|
1557
|
-
version = "1.
|
1586
|
+
version = "1.47.0"
|
1558
1587
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1559
|
-
checksum = "
|
1588
|
+
checksum = "43864ed400b6043a4757a25c7a64a8efde741aed79a056a2fb348a406701bb35"
|
1560
1589
|
dependencies = [
|
1561
1590
|
"backtrace",
|
1562
1591
|
"bytes",
|
1592
|
+
"io-uring",
|
1563
1593
|
"libc",
|
1564
1594
|
"mio",
|
1565
1595
|
"pin-project-lite",
|
1566
|
-
"
|
1567
|
-
"
|
1596
|
+
"slab",
|
1597
|
+
"socket2 0.6.0",
|
1598
|
+
"windows-sys 0.59.0",
|
1568
1599
|
]
|
1569
1600
|
|
1570
1601
|
[[package]]
|
@@ -1811,9 +1842,9 @@ dependencies = [
|
|
1811
1842
|
|
1812
1843
|
[[package]]
|
1813
1844
|
name = "webpki-roots"
|
1814
|
-
version = "1.0.
|
1845
|
+
version = "1.0.2"
|
1815
1846
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1816
|
-
checksum = "
|
1847
|
+
checksum = "7e8983c3ab33d6fb807cfcdad2491c4ea8cbc8ed839181c7dfd9c67c83e261b2"
|
1817
1848
|
dependencies = [
|
1818
1849
|
"rustls-pki-types",
|
1819
1850
|
]
|
data/ext/css_inline/Cargo.toml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
[package]
|
2
2
|
name = "css-inline"
|
3
|
-
version = "0.
|
3
|
+
version = "0.17.0"
|
4
4
|
authors = ["Dmitry Dygalo <dmitry@dygalo.dev>"]
|
5
5
|
edition = "2021"
|
6
6
|
readme = "README.rdoc"
|
@@ -20,6 +20,6 @@ magnus = "0.7"
|
|
20
20
|
rayon = "1"
|
21
21
|
|
22
22
|
[dependencies.css-inline]
|
23
|
-
version = "0.
|
23
|
+
version = "0.17"
|
24
24
|
default-features = false
|
25
25
|
features = ["http", "file", "stylesheet-cache"]
|
data/ext/css_inline/src/lib.rs
CHANGED
@@ -52,6 +52,7 @@ fn parse_options<Req>(
|
|
52
52
|
Option<bool>,
|
53
53
|
Option<bool>,
|
54
54
|
Option<bool>,
|
55
|
+
Option<bool>,
|
55
56
|
Option<String>,
|
56
57
|
Option<bool>,
|
57
58
|
Option<Obj<StylesheetCache>>,
|
@@ -66,6 +67,7 @@ fn parse_options<Req>(
|
|
66
67
|
"inline_style_tags",
|
67
68
|
"keep_style_tags",
|
68
69
|
"keep_link_tags",
|
70
|
+
"keep_at_rules",
|
69
71
|
"base_url",
|
70
72
|
"load_remote_stylesheets",
|
71
73
|
"cache",
|
@@ -78,13 +80,14 @@ fn parse_options<Req>(
|
|
78
80
|
inline_style_tags: kwargs.0.unwrap_or(true),
|
79
81
|
keep_style_tags: kwargs.1.unwrap_or(false),
|
80
82
|
keep_link_tags: kwargs.2.unwrap_or(false),
|
81
|
-
|
82
|
-
|
83
|
+
keep_at_rules: kwargs.3.unwrap_or(false),
|
84
|
+
base_url: parse_url(kwargs.4)?,
|
85
|
+
load_remote_stylesheets: kwargs.5.unwrap_or(true),
|
83
86
|
cache: kwargs
|
84
|
-
.
|
87
|
+
.6
|
85
88
|
.map(|cache| Mutex::new(rust_inline::StylesheetCache::new(cache.size))),
|
86
|
-
extra_css: kwargs.
|
87
|
-
preallocate_node_capacity: kwargs.
|
89
|
+
extra_css: kwargs.7.map(Cow::Owned),
|
90
|
+
preallocate_node_capacity: kwargs.8.unwrap_or(32),
|
88
91
|
resolver: Arc::new(rust_inline::DefaultStylesheetResolver),
|
89
92
|
})
|
90
93
|
}
|
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.17.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-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rb_sys
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
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
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: nokogiri
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|