css-inline 0.21.1__tar.gz → 0.21.2__tar.gz

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.
Files changed (34) hide show
  1. {css_inline-0.21.1 → css_inline-0.21.2}/PKG-INFO +1 -1
  2. {css_inline-0.21.1 → css_inline-0.21.2}/bindings/python/CHANGELOG.md +8 -1
  3. {css_inline-0.21.1 → css_inline-0.21.2}/bindings/python/Cargo.lock +52 -52
  4. {css_inline-0.21.1 → css_inline-0.21.2}/bindings/python/Cargo.toml +1 -1
  5. {css_inline-0.21.1 → css_inline-0.21.2}/css-inline/Cargo.toml +1 -1
  6. {css_inline-0.21.1 → css_inline-0.21.2}/css-inline/src/resolver.rs +22 -5
  7. {css_inline-0.21.1 → css_inline-0.21.2}/LICENSE +0 -0
  8. {css_inline-0.21.1 → css_inline-0.21.2}/README.md +0 -0
  9. {css_inline-0.21.1 → css_inline-0.21.2}/bindings/python/README.md +0 -0
  10. {css_inline-0.21.1 → css_inline-0.21.2}/bindings/python/build.rs +0 -0
  11. {css_inline-0.21.1 → css_inline-0.21.2}/bindings/python/src/lib.rs +0 -0
  12. {css_inline-0.21.1 → css_inline-0.21.2}/css-inline/README.md +0 -0
  13. {css_inline-0.21.1 → css_inline-0.21.2}/css-inline/benches/inliner.rs +0 -0
  14. {css_inline-0.21.1 → css_inline-0.21.2}/css-inline/rustfmt.toml +0 -0
  15. {css_inline-0.21.1 → css_inline-0.21.2}/css-inline/src/error.rs +0 -0
  16. {css_inline-0.21.1 → css_inline-0.21.2}/css-inline/src/html/attributes.rs +0 -0
  17. {css_inline-0.21.1 → css_inline-0.21.2}/css-inline/src/html/document.rs +0 -0
  18. {css_inline-0.21.1 → css_inline-0.21.2}/css-inline/src/html/element.rs +0 -0
  19. {css_inline-0.21.1 → css_inline-0.21.2}/css-inline/src/html/iter.rs +0 -0
  20. {css_inline-0.21.1 → css_inline-0.21.2}/css-inline/src/html/mod.rs +0 -0
  21. {css_inline-0.21.1 → css_inline-0.21.2}/css-inline/src/html/node.rs +0 -0
  22. {css_inline-0.21.1 → css_inline-0.21.2}/css-inline/src/html/parser.rs +0 -0
  23. {css_inline-0.21.1 → css_inline-0.21.2}/css-inline/src/html/selectors/attr_value.rs +0 -0
  24. {css_inline-0.21.1 → css_inline-0.21.2}/css-inline/src/html/selectors/local_name.rs +0 -0
  25. {css_inline-0.21.1 → css_inline-0.21.2}/css-inline/src/html/selectors/mod.rs +0 -0
  26. {css_inline-0.21.1 → css_inline-0.21.2}/css-inline/src/html/selectors/parser.rs +0 -0
  27. {css_inline-0.21.1 → css_inline-0.21.2}/css-inline/src/html/selectors/pseudo_classes.rs +0 -0
  28. {css_inline-0.21.1 → css_inline-0.21.2}/css-inline/src/html/selectors/pseudo_elements.rs +0 -0
  29. {css_inline-0.21.1 → css_inline-0.21.2}/css-inline/src/html/selectors/selector_impl.rs +0 -0
  30. {css_inline-0.21.1 → css_inline-0.21.2}/css-inline/src/html/serializer.rs +0 -0
  31. {css_inline-0.21.1 → css_inline-0.21.2}/css-inline/src/lib.rs +0 -0
  32. {css_inline-0.21.1 → css_inline-0.21.2}/css-inline/src/main.rs +0 -0
  33. {css_inline-0.21.1 → css_inline-0.21.2}/css-inline/src/parser.rs +0 -0
  34. {css_inline-0.21.1 → css_inline-0.21.2}/pyproject.toml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: css-inline
3
- Version: 0.21.1
3
+ Version: 0.21.2
4
4
  Classifier: Development Status :: 4 - Beta
5
5
  Classifier: Intended Audience :: Developers
6
6
  Classifier: License :: OSI Approved :: MIT License
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.21.2] - 2026-08-24
6
+
7
+ ### Fixed
8
+
9
+ - `file://` stylesheet URLs not percent-decoded and broken on Windows drive letters.
10
+
5
11
  ## [0.21.1] - 2026-08-08
6
12
 
7
13
  ### Fixed
@@ -591,7 +597,8 @@
591
597
 
592
598
  - Initial public release
593
599
 
594
- [Unreleased]: https://github.com/Stranger6667/css-inline/compare/python-v0.21.1...HEAD
600
+ [Unreleased]: https://github.com/Stranger6667/css-inline/compare/python-v0.21.2...HEAD
601
+ [0.21.2]: https://github.com/Stranger6667/css-inline/compare/python-v0.21.1...python-v0.21.2
595
602
  [0.21.1]: https://github.com/Stranger6667/css-inline/compare/python-v0.21.0...python-v0.21.1
596
603
  [0.21.0]: https://github.com/Stranger6667/css-inline/compare/python-v0.20.2...python-v0.21.0
597
604
  [0.20.2]: https://github.com/Stranger6667/css-inline/compare/python-v0.20.1...python-v0.20.2
@@ -77,9 +77,9 @@ dependencies = [
77
77
 
78
78
  [[package]]
79
79
  name = "cc"
80
- version = "1.4.2"
80
+ version = "1.4.4"
81
81
  source = "registry+https://github.com/rust-lang/crates.io-index"
82
- checksum = "5d262e149917187838d5b42777c8253bcb64500067342904e7d429499a6f277e"
82
+ checksum = "0ad534f4357a5264cce5019c989cf66a4f0dc4e0d1b1d15f8aacec0ff7360273"
83
83
  dependencies = [
84
84
  "find-msvc-tools",
85
85
  "shlex",
@@ -161,7 +161,7 @@ checksum = "61803da095bee82a81bb1a452ecc25d3b2f1416d1897eb86430c6159ef717c17"
161
161
 
162
162
  [[package]]
163
163
  name = "css-inline"
164
- version = "0.21.1"
164
+ version = "0.21.2"
165
165
  dependencies = [
166
166
  "cssparser",
167
167
  "html5ever",
@@ -177,7 +177,7 @@ dependencies = [
177
177
 
178
178
  [[package]]
179
179
  name = "css-inline-python"
180
- version = "0.21.1"
180
+ version = "0.21.2"
181
181
  dependencies = [
182
182
  "built",
183
183
  "css-inline",
@@ -239,7 +239,7 @@ checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8"
239
239
  dependencies = [
240
240
  "proc-macro2",
241
241
  "quote",
242
- "syn 3.0.3",
242
+ "syn 3.0.4",
243
243
  ]
244
244
 
245
245
  [[package]]
@@ -259,9 +259,9 @@ dependencies = [
259
259
 
260
260
  [[package]]
261
261
  name = "either"
262
- version = "1.17.0"
262
+ version = "1.18.0"
263
263
  source = "registry+https://github.com/rust-lang/crates.io-index"
264
- checksum = "9e5e8f6c15a24b9a3ee5efec809ccd006d3b30e8b3bb63c39af737c7f87daa1d"
264
+ checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34"
265
265
 
266
266
  [[package]]
267
267
  name = "equivalent"
@@ -277,9 +277,9 @@ checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223"
277
277
 
278
278
  [[package]]
279
279
  name = "find-msvc-tools"
280
- version = "0.1.10"
280
+ version = "0.1.11"
281
281
  source = "registry+https://github.com/rust-lang/crates.io-index"
282
- checksum = "26b73573e6edcd2af0cdf47bd6cb58f0b3839491263c314eaad1ccf24430e1de"
282
+ checksum = "d45db016d36b838f563236e9193d0ee6ce38f3f68b6c94e914b4929c96bbb890"
283
283
 
284
284
  [[package]]
285
285
  name = "foldhash"
@@ -298,9 +298,9 @@ dependencies = [
298
298
 
299
299
  [[package]]
300
300
  name = "futures-channel"
301
- version = "0.3.33"
301
+ version = "0.3.34"
302
302
  source = "registry+https://github.com/rust-lang/crates.io-index"
303
- checksum = "262590f4fe6afeb0bc83be1daa64e52657fe185690a958af7f3ad0e92085c5ae"
303
+ checksum = "b1f9e3d69d39e4862ffed03ed071a76f9a13ba1d9109d355b0f0aa6b15e393c4"
304
304
  dependencies = [
305
305
  "futures-core",
306
306
  "futures-sink",
@@ -308,33 +308,33 @@ dependencies = [
308
308
 
309
309
  [[package]]
310
310
  name = "futures-core"
311
- version = "0.3.33"
311
+ version = "0.3.34"
312
312
  source = "registry+https://github.com/rust-lang/crates.io-index"
313
- checksum = "2cd50c473c80f6d7c3670a752354b8e569b1a7cbfdc0419ec88e5edad85e0dc7"
313
+ checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e"
314
314
 
315
315
  [[package]]
316
316
  name = "futures-io"
317
- version = "0.3.33"
317
+ version = "0.3.34"
318
318
  source = "registry+https://github.com/rust-lang/crates.io-index"
319
- checksum = "4577ecaa3c4f96589d473f679a71b596316f6641bc350038b962a5daf0085d7a"
319
+ checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed"
320
320
 
321
321
  [[package]]
322
322
  name = "futures-sink"
323
- version = "0.3.33"
323
+ version = "0.3.34"
324
324
  source = "registry+https://github.com/rust-lang/crates.io-index"
325
- checksum = "e34418ac499d6305c2fb5ad0ed2f6ac998c5f8ca209b4510f7f94242c647e307"
325
+ checksum = "1944426bf7d03f1d14f708785e4b33efd750b36d48a157b836b3efc15ede8e1d"
326
326
 
327
327
  [[package]]
328
328
  name = "futures-task"
329
- version = "0.3.33"
329
+ version = "0.3.34"
330
330
  source = "registry+https://github.com/rust-lang/crates.io-index"
331
- checksum = "b231ed28831efb4a61a08580c4bc233ec56bc009f4cd8f52da2c3cb97df0c109"
331
+ checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd"
332
332
 
333
333
  [[package]]
334
334
  name = "futures-util"
335
- version = "0.3.33"
335
+ version = "0.3.34"
336
336
  source = "registry+https://github.com/rust-lang/crates.io-index"
337
- checksum = "a77a90a256fce34da66415271e30f94ee91c57b04b8a2c042d9cf3220179deaa"
337
+ checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc"
338
338
  dependencies = [
339
339
  "futures-core",
340
340
  "futures-io",
@@ -421,9 +421,9 @@ dependencies = [
421
421
 
422
422
  [[package]]
423
423
  name = "http-body-util"
424
- version = "0.1.4"
424
+ version = "0.1.5"
425
425
  source = "registry+https://github.com/rust-lang/crates.io-index"
426
- checksum = "e9f41fd6a08e4d4ec69df65976da761afd5ad5e58a9d4acb46bd1c953a9e3ff2"
426
+ checksum = "23169fe34a5fbcdd3f3862e78fb9b6fccd5f02a6dc6f732547005d45631ce71c"
427
427
  dependencies = [
428
428
  "bytes",
429
429
  "futures-core",
@@ -664,9 +664,9 @@ checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2"
664
664
 
665
665
  [[package]]
666
666
  name = "litemap"
667
- version = "0.8.2"
667
+ version = "0.8.3"
668
668
  source = "registry+https://github.com/rust-lang/crates.io-index"
669
- checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0"
669
+ checksum = "47d9d19d1d6efa0109d2f65ff4c85cddd50bd572e5a00127ab10987290bcefae"
670
670
 
671
671
  [[package]]
672
672
  name = "lock_api"
@@ -679,9 +679,9 @@ dependencies = [
679
679
 
680
680
  [[package]]
681
681
  name = "log"
682
- version = "0.4.33"
682
+ version = "0.4.34"
683
683
  source = "registry+https://github.com/rust-lang/crates.io-index"
684
- checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad"
684
+ checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6"
685
685
 
686
686
  [[package]]
687
687
  name = "lru"
@@ -837,15 +837,15 @@ checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
837
837
 
838
838
  [[package]]
839
839
  name = "portable-atomic"
840
- version = "1.14.0"
840
+ version = "1.15.0"
841
841
  source = "registry+https://github.com/rust-lang/crates.io-index"
842
- checksum = "3d20d5497ef88037a52ff98267d066e7f11fcc5e99bbfbd58a42336193aacec3"
842
+ checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85"
843
843
 
844
844
  [[package]]
845
845
  name = "potential_utf"
846
- version = "0.1.5"
846
+ version = "0.1.6"
847
847
  source = "registry+https://github.com/rust-lang/crates.io-index"
848
- checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564"
848
+ checksum = "d83eb9bc6d8e5cf568e7a1101d60ee05e81ed50ea106026f3d18deeb046d7661"
849
849
  dependencies = [
850
850
  "zerovec",
851
851
  ]
@@ -950,9 +950,9 @@ dependencies = [
950
950
 
951
951
  [[package]]
952
952
  name = "quinn-proto"
953
- version = "0.11.16"
953
+ version = "0.11.17"
954
954
  source = "registry+https://github.com/rust-lang/crates.io-index"
955
- checksum = "2f4bfc015262b9df63c8845072ce59068853ff5872180c2ce2f13038b970e560"
955
+ checksum = "04759210543be93709136e28212294a659ef5001836ff4eab4d663e4529bba83"
956
956
  dependencies = [
957
957
  "bytes",
958
958
  "getrandom 0.4.3",
@@ -1149,9 +1149,9 @@ dependencies = [
1149
1149
 
1150
1150
  [[package]]
1151
1151
  name = "rustls-webpki"
1152
- version = "0.103.13"
1152
+ version = "0.103.15"
1153
1153
  source = "registry+https://github.com/rust-lang/crates.io-index"
1154
- checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e"
1154
+ checksum = "f3c3cf1d8b1e7d4927e2d154c3fcb02979afb9939629c62cd9048d4f07b60ac2"
1155
1155
  dependencies = [
1156
1156
  "ring",
1157
1157
  "rustls-pki-types",
@@ -1232,7 +1232,7 @@ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
1232
1232
  dependencies = [
1233
1233
  "proc-macro2",
1234
1234
  "quote",
1235
- "syn 3.0.3",
1235
+ "syn 3.0.4",
1236
1236
  ]
1237
1237
 
1238
1238
  [[package]]
@@ -1361,9 +1361,9 @@ dependencies = [
1361
1361
 
1362
1362
  [[package]]
1363
1363
  name = "syn"
1364
- version = "3.0.3"
1364
+ version = "3.0.4"
1365
1365
  source = "registry+https://github.com/rust-lang/crates.io-index"
1366
- checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3"
1366
+ checksum = "e6275cddf4610d1775e6d1fe9469b2e77d0f39fd98fb7450901b821e0c53649f"
1367
1367
  dependencies = [
1368
1368
  "proc-macro2",
1369
1369
  "quote",
@@ -1422,14 +1422,14 @@ checksum = "bc04cd3e1236dd4a98afca4569f2deb3f120e5422a4023be2cb683f8486292af"
1422
1422
  dependencies = [
1423
1423
  "proc-macro2",
1424
1424
  "quote",
1425
- "syn 3.0.3",
1425
+ "syn 3.0.4",
1426
1426
  ]
1427
1427
 
1428
1428
  [[package]]
1429
1429
  name = "tinystr"
1430
- version = "0.8.3"
1430
+ version = "0.8.4"
1431
1431
  source = "registry+https://github.com/rust-lang/crates.io-index"
1432
- checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d"
1432
+ checksum = "b1e27c91459209c2986af3dcf603a5a74a4368754ce37414f59acc971167f643"
1433
1433
  dependencies = [
1434
1434
  "displaydoc",
1435
1435
  "zerovec",
@@ -1707,9 +1707,9 @@ dependencies = [
1707
1707
 
1708
1708
  [[package]]
1709
1709
  name = "web_atoms"
1710
- version = "0.2.5"
1710
+ version = "0.2.6"
1711
1711
  source = "registry+https://github.com/rust-lang/crates.io-index"
1712
- checksum = "075474b12bcb3d2e3d4546580e9de478eeeead668a1761e2a8860c836b7ef297"
1712
+ checksum = "ba8b815c1b593dc0baf78dd0f4fc8fdb2de53198fb1163738093e9a311c33fb3"
1713
1713
  dependencies = [
1714
1714
  "phf",
1715
1715
  "phf_codegen",
@@ -1878,9 +1878,9 @@ dependencies = [
1878
1878
 
1879
1879
  [[package]]
1880
1880
  name = "writeable"
1881
- version = "0.6.3"
1881
+ version = "0.6.4"
1882
1882
  source = "registry+https://github.com/rust-lang/crates.io-index"
1883
- checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4"
1883
+ checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc"
1884
1884
 
1885
1885
  [[package]]
1886
1886
  name = "yoke"
@@ -1934,9 +1934,9 @@ checksum = "e13c156562582aa81c60cb29407084cdb54c4164760106ab78e6c5b0858cf64e"
1934
1934
 
1935
1935
  [[package]]
1936
1936
  name = "zerotrie"
1937
- version = "0.2.4"
1937
+ version = "0.2.5"
1938
1938
  source = "registry+https://github.com/rust-lang/crates.io-index"
1939
- checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf"
1939
+ checksum = "4ea269c3bd32f0a32c321907a2ae912ba6f4649bb0fc764a15627e99a7095a3f"
1940
1940
  dependencies = [
1941
1941
  "displaydoc",
1942
1942
  "yoke",
@@ -1945,9 +1945,9 @@ dependencies = [
1945
1945
 
1946
1946
  [[package]]
1947
1947
  name = "zerovec"
1948
- version = "0.11.6"
1948
+ version = "0.11.8"
1949
1949
  source = "registry+https://github.com/rust-lang/crates.io-index"
1950
- checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239"
1950
+ checksum = "bb0464e17806c1d976d5cba29399c7f08e516e279e2ba493f63123b5fca67dd8"
1951
1951
  dependencies = [
1952
1952
  "yoke",
1953
1953
  "zerofrom",
@@ -1956,13 +1956,13 @@ dependencies = [
1956
1956
 
1957
1957
  [[package]]
1958
1958
  name = "zerovec-derive"
1959
- version = "0.11.3"
1959
+ version = "0.11.6"
1960
1960
  source = "registry+https://github.com/rust-lang/crates.io-index"
1961
- checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555"
1961
+ checksum = "34df6fc39dbd26ddc9c10e6a2984476e13acce22e64e4487636ef494369225da"
1962
1962
  dependencies = [
1963
1963
  "proc-macro2",
1964
1964
  "quote",
1965
- "syn 2.0.119",
1965
+ "syn 3.0.4",
1966
1966
  ]
1967
1967
 
1968
1968
  [[package]]
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "css-inline-python"
3
- version = "0.21.1"
3
+ version = "0.21.2"
4
4
  authors = ["Dmitry Dygalo <dmitry@dygalo.dev>"]
5
5
  edition = "2024"
6
6
  rust-version = "1.85"
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "css-inline"
3
- version = "0.21.1"
3
+ version = "0.21.2"
4
4
  authors = ["Dmitry Dygalo <dmitry@dygalo.dev>"]
5
5
  edition = "2021"
6
6
  license = "MIT"
@@ -1,5 +1,21 @@
1
1
  use crate::{InlineError, Result};
2
- use std::io::ErrorKind;
2
+ use std::{borrow::Cow, io::ErrorKind, path::Path};
3
+
4
+ /// Turn a `file://` URL into a filesystem path.
5
+ ///
6
+ /// Percent-decodes the path and handles Windows drive letters. URLs with a host
7
+ /// (e.g. `file://relative-dir/`) keep the legacy prefix-stripping behavior.
8
+ fn to_file_path(location: &str) -> Cow<'_, Path> {
9
+ #[cfg(any(unix, windows, target_os = "redox", target_os = "wasi"))]
10
+ if let Ok(url) = url::Url::parse(location) {
11
+ if url.scheme() == "file" && url.host().is_none() {
12
+ if let Ok(path) = url.to_file_path() {
13
+ return Cow::Owned(path);
14
+ }
15
+ }
16
+ }
17
+ Cow::Borrowed(Path::new(location.trim_start_matches("file://")))
18
+ }
3
19
 
4
20
  /// Blocking way of resolving stylesheets from various sources.
5
21
  pub trait StylesheetResolver: Send + Sync {
@@ -52,14 +68,15 @@ pub trait StylesheetResolver: Send + Sync {
52
68
  ///
53
69
  /// Any filesystem-related error.
54
70
  fn retrieve_from_path(&self, path: &str) -> Result<String> {
55
- let path = path.trim_start_matches("file://");
56
- std::fs::read_to_string(path).map_err(|error| match error.kind() {
71
+ let path = to_file_path(path);
72
+ std::fs::read_to_string(&path).map_err(|error| match error.kind() {
57
73
  ErrorKind::NotFound => InlineError::MissingStyleSheet {
58
- path: path.to_string(),
74
+ path: path.display().to_string(),
59
75
  },
60
76
  #[cfg(target_family = "wasm")]
61
77
  ErrorKind::Unsupported => self.unsupported(&format!(
62
- "Loading local files is not supported on WASM: {path}"
78
+ "Loading local files is not supported on WASM: {}",
79
+ path.display()
63
80
  )),
64
81
  _ => InlineError::IO(error),
65
82
  })
File without changes
File without changes
File without changes