css-inline 0.20.0__tar.gz → 0.20.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.20.0 → css_inline-0.20.2}/PKG-INFO +2 -2
  2. {css_inline-0.20.0/bindings/python → css_inline-0.20.2}/README.md +1 -1
  3. {css_inline-0.20.0 → css_inline-0.20.2}/bindings/python/CHANGELOG.md +21 -1
  4. {css_inline-0.20.0 → css_inline-0.20.2}/bindings/python/Cargo.lock +123 -133
  5. {css_inline-0.20.0 → css_inline-0.20.2}/bindings/python/Cargo.toml +1 -1
  6. {css_inline-0.20.0 → css_inline-0.20.2/bindings/python}/README.md +1 -1
  7. {css_inline-0.20.0 → css_inline-0.20.2}/css-inline/Cargo.toml +3 -6
  8. {css_inline-0.20.0 → css_inline-0.20.2}/css-inline/README.md +2 -1
  9. {css_inline-0.20.0 → css_inline-0.20.2}/css-inline/src/html/document.rs +3 -3
  10. {css_inline-0.20.0 → css_inline-0.20.2}/css-inline/src/html/serializer.rs +16 -5
  11. {css_inline-0.20.0 → css_inline-0.20.2}/css-inline/src/lib.rs +12 -0
  12. {css_inline-0.20.0 → css_inline-0.20.2}/LICENSE +0 -0
  13. {css_inline-0.20.0 → css_inline-0.20.2}/bindings/python/build.rs +0 -0
  14. {css_inline-0.20.0 → css_inline-0.20.2}/bindings/python/src/lib.rs +0 -0
  15. {css_inline-0.20.0 → css_inline-0.20.2}/css-inline/benches/inliner.rs +0 -0
  16. {css_inline-0.20.0 → css_inline-0.20.2}/css-inline/rustfmt.toml +0 -0
  17. {css_inline-0.20.0 → css_inline-0.20.2}/css-inline/src/error.rs +0 -0
  18. {css_inline-0.20.0 → css_inline-0.20.2}/css-inline/src/html/attributes.rs +0 -0
  19. {css_inline-0.20.0 → css_inline-0.20.2}/css-inline/src/html/element.rs +0 -0
  20. {css_inline-0.20.0 → css_inline-0.20.2}/css-inline/src/html/iter.rs +0 -0
  21. {css_inline-0.20.0 → css_inline-0.20.2}/css-inline/src/html/mod.rs +0 -0
  22. {css_inline-0.20.0 → css_inline-0.20.2}/css-inline/src/html/node.rs +0 -0
  23. {css_inline-0.20.0 → css_inline-0.20.2}/css-inline/src/html/parser.rs +0 -0
  24. {css_inline-0.20.0 → css_inline-0.20.2}/css-inline/src/html/selectors/attr_value.rs +0 -0
  25. {css_inline-0.20.0 → css_inline-0.20.2}/css-inline/src/html/selectors/local_name.rs +0 -0
  26. {css_inline-0.20.0 → css_inline-0.20.2}/css-inline/src/html/selectors/mod.rs +0 -0
  27. {css_inline-0.20.0 → css_inline-0.20.2}/css-inline/src/html/selectors/parser.rs +0 -0
  28. {css_inline-0.20.0 → css_inline-0.20.2}/css-inline/src/html/selectors/pseudo_classes.rs +0 -0
  29. {css_inline-0.20.0 → css_inline-0.20.2}/css-inline/src/html/selectors/pseudo_elements.rs +0 -0
  30. {css_inline-0.20.0 → css_inline-0.20.2}/css-inline/src/html/selectors/selector_impl.rs +0 -0
  31. {css_inline-0.20.0 → css_inline-0.20.2}/css-inline/src/main.rs +0 -0
  32. {css_inline-0.20.0 → css_inline-0.20.2}/css-inline/src/parser.rs +0 -0
  33. {css_inline-0.20.0 → css_inline-0.20.2}/css-inline/src/resolver.rs +0 -0
  34. {css_inline-0.20.0 → css_inline-0.20.2}/pyproject.toml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: css-inline
3
- Version: 0.20.0
3
+ Version: 0.20.2
4
4
  Classifier: Development Status :: 4 - Beta
5
5
  Classifier: Intended Audience :: Developers
6
6
  Classifier: License :: OSI Approved :: MIT License
@@ -118,7 +118,7 @@ inlined = css_inline.inline(HTML)
118
118
 
119
119
  Note that `css-inline` automatically adds missing `html` and `body` tags, so the output is a valid HTML document.
120
120
 
121
- Alternatively, you can inline CSS into an HTML fragment, preserving the original structure:
121
+ Alternatively, you can inline CSS into an HTML fragment. Structural tags (`<html>`, `<head>`, `<body>`) are stripped from the output; only their contents are preserved. Use `inline` if you need to keep the full document structure:
122
122
 
123
123
  ```python
124
124
  FRAGMENT = """<main>
@@ -90,7 +90,7 @@ inlined = css_inline.inline(HTML)
90
90
 
91
91
  Note that `css-inline` automatically adds missing `html` and `body` tags, so the output is a valid HTML document.
92
92
 
93
- Alternatively, you can inline CSS into an HTML fragment, preserving the original structure:
93
+ Alternatively, you can inline CSS into an HTML fragment. Structural tags (`<html>`, `<head>`, `<body>`) are stripped from the output; only their contents are preserved. Use `inline` if you need to keep the full document structure:
94
94
 
95
95
  ```python
96
96
  FRAGMENT = """<main>
@@ -2,6 +2,24 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.20.2] - 2026-04-02
6
+
7
+ ### Fixed
8
+
9
+ - `inline_fragment` silently returning only whitespace when the input starts with whitespace or contains structural HTML tags (`<html>`, `<head>`, `<body>`, `<style>`). [#692](https://github.com/Stranger6667/css-inline/issues/692) [#693](https://github.com/Stranger6667/css-inline/issues/693)
10
+
11
+ ## [0.20.1] - 2026-03-26
12
+
13
+ ### Changed
14
+
15
+ - Update `html5ever` to `0.39`.
16
+ - Update `selectors` to `0.36`.
17
+
18
+ ### Fixed
19
+
20
+ - `!important` lost when inlining styles onto elements with existing inline `style` attributes. [#682](https://github.com/Stranger6667/css-inline/issues/682)
21
+ - `!important` lost when `minify_css` is enabled due to separator mismatch during property lookup. [#682](https://github.com/Stranger6667/css-inline/issues/682)
22
+
5
23
  ## [0.20.0] - 2026-02-07
6
24
 
7
25
  ### Added
@@ -551,7 +569,9 @@
551
569
 
552
570
  - Initial public release
553
571
 
554
- [Unreleased]: https://github.com/Stranger6667/css-inline/compare/python-v0.20.0...HEAD
572
+ [Unreleased]: https://github.com/Stranger6667/css-inline/compare/python-v0.20.2...HEAD
573
+ [0.20.2]: https://github.com/Stranger6667/css-inline/compare/python-v0.20.1...python-v0.20.2
574
+ [0.20.1]: https://github.com/Stranger6667/css-inline/compare/python-v0.20.0...python-v0.20.1
555
575
  [0.20.0]: https://github.com/Stranger6667/css-inline/compare/python-v0.19.1...python-v0.20.0
556
576
  [0.19.1]: https://github.com/Stranger6667/css-inline/compare/python-v0.19.0...python-v0.19.1
557
577
  [0.19.0]: https://github.com/Stranger6667/css-inline/compare/python-v0.18.0...python-v0.19.0
@@ -37,9 +37,9 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
37
37
 
38
38
  [[package]]
39
39
  name = "bitflags"
40
- version = "2.10.0"
40
+ version = "2.11.0"
41
41
  source = "registry+https://github.com/rust-lang/crates.io-index"
42
- checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3"
42
+ checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af"
43
43
 
44
44
  [[package]]
45
45
  name = "built"
@@ -53,9 +53,9 @@ dependencies = [
53
53
 
54
54
  [[package]]
55
55
  name = "bumpalo"
56
- version = "3.19.1"
56
+ version = "3.20.2"
57
57
  source = "registry+https://github.com/rust-lang/crates.io-index"
58
- checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510"
58
+ checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb"
59
59
 
60
60
  [[package]]
61
61
  name = "bytes"
@@ -77,9 +77,9 @@ dependencies = [
77
77
 
78
78
  [[package]]
79
79
  name = "cc"
80
- version = "1.2.55"
80
+ version = "1.2.58"
81
81
  source = "registry+https://github.com/rust-lang/crates.io-index"
82
- checksum = "47b26a0954ae34af09b50f0de26458fa95369a0d478d8236d3f93082b219bd29"
82
+ checksum = "e1e928d4b69e3077709075a938a05ffbedfa53a84c8f766efbf8220bb1ff60e1"
83
83
  dependencies = [
84
84
  "find-msvc-tools",
85
85
  "shlex",
@@ -99,9 +99,9 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
99
99
 
100
100
  [[package]]
101
101
  name = "chrono"
102
- version = "0.4.43"
102
+ version = "0.4.44"
103
103
  source = "registry+https://github.com/rust-lang/crates.io-index"
104
- checksum = "fac4744fb15ae8337dc853fee7fb3f4e48c0fbaa23d0afe49c447b4fab126118"
104
+ checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0"
105
105
  dependencies = [
106
106
  "iana-time-zone",
107
107
  "num-traits",
@@ -141,7 +141,7 @@ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
141
141
 
142
142
  [[package]]
143
143
  name = "css-inline"
144
- version = "0.20.0"
144
+ version = "0.20.2"
145
145
  dependencies = [
146
146
  "cssparser",
147
147
  "html5ever",
@@ -157,7 +157,7 @@ dependencies = [
157
157
 
158
158
  [[package]]
159
159
  name = "css-inline-python"
160
- version = "0.20.0"
160
+ version = "0.20.2"
161
161
  dependencies = [
162
162
  "built",
163
163
  "css-inline",
@@ -278,9 +278,9 @@ dependencies = [
278
278
 
279
279
  [[package]]
280
280
  name = "futures-channel"
281
- version = "0.3.31"
281
+ version = "0.3.32"
282
282
  source = "registry+https://github.com/rust-lang/crates.io-index"
283
- checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10"
283
+ checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d"
284
284
  dependencies = [
285
285
  "futures-core",
286
286
  "futures-sink",
@@ -288,33 +288,33 @@ dependencies = [
288
288
 
289
289
  [[package]]
290
290
  name = "futures-core"
291
- version = "0.3.31"
291
+ version = "0.3.32"
292
292
  source = "registry+https://github.com/rust-lang/crates.io-index"
293
- checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e"
293
+ checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d"
294
294
 
295
295
  [[package]]
296
296
  name = "futures-io"
297
- version = "0.3.31"
297
+ version = "0.3.32"
298
298
  source = "registry+https://github.com/rust-lang/crates.io-index"
299
- checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6"
299
+ checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718"
300
300
 
301
301
  [[package]]
302
302
  name = "futures-sink"
303
- version = "0.3.31"
303
+ version = "0.3.32"
304
304
  source = "registry+https://github.com/rust-lang/crates.io-index"
305
- checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7"
305
+ checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893"
306
306
 
307
307
  [[package]]
308
308
  name = "futures-task"
309
- version = "0.3.31"
309
+ version = "0.3.32"
310
310
  source = "registry+https://github.com/rust-lang/crates.io-index"
311
- checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988"
311
+ checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393"
312
312
 
313
313
  [[package]]
314
314
  name = "futures-util"
315
- version = "0.3.31"
315
+ version = "0.3.32"
316
316
  source = "registry+https://github.com/rust-lang/crates.io-index"
317
- checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81"
317
+ checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6"
318
318
  dependencies = [
319
319
  "futures-core",
320
320
  "futures-io",
@@ -322,7 +322,6 @@ dependencies = [
322
322
  "futures-task",
323
323
  "memchr",
324
324
  "pin-project-lite",
325
- "pin-utils",
326
325
  "slab",
327
326
  ]
328
327
 
@@ -372,9 +371,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
372
371
 
373
372
  [[package]]
374
373
  name = "html5ever"
375
- version = "0.38.0"
374
+ version = "0.39.0"
376
375
  source = "registry+https://github.com/rust-lang/crates.io-index"
377
- checksum = "1054432bae2f14e0061e33d23402fbaa67a921d319d56adc6bcf887ddad1cbc2"
376
+ checksum = "46a1761807faccc9a19e86944bbf40610014066306f96edcdedc2fb714bcb7b8"
378
377
  dependencies = [
379
378
  "log",
380
379
  "markup5ever",
@@ -421,9 +420,9 @@ checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87"
421
420
 
422
421
  [[package]]
423
422
  name = "hyper"
424
- version = "1.8.1"
423
+ version = "1.9.0"
425
424
  source = "registry+https://github.com/rust-lang/crates.io-index"
426
- checksum = "2ab2d4f250c3d7b1c9fcdff1cece94ea4e2dfbec68614f7b87cb205f24ca9d11"
425
+ checksum = "6299f016b246a94207e63da54dbe807655bf9e00044f73ded42c3ac5305fbcca"
427
426
  dependencies = [
428
427
  "atomic-waker",
429
428
  "bytes",
@@ -434,7 +433,6 @@ dependencies = [
434
433
  "httparse",
435
434
  "itoa",
436
435
  "pin-project-lite",
437
- "pin-utils",
438
436
  "smallvec",
439
437
  "tokio",
440
438
  "want",
@@ -618,15 +616,15 @@ dependencies = [
618
616
 
619
617
  [[package]]
620
618
  name = "ipnet"
621
- version = "2.11.0"
619
+ version = "2.12.0"
622
620
  source = "registry+https://github.com/rust-lang/crates.io-index"
623
- checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130"
621
+ checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2"
624
622
 
625
623
  [[package]]
626
624
  name = "iri-string"
627
- version = "0.7.10"
625
+ version = "0.7.12"
628
626
  source = "registry+https://github.com/rust-lang/crates.io-index"
629
- checksum = "c91338f0783edbd6195decb37bae672fd3b165faffb89bf7b9e6942f8b1a731a"
627
+ checksum = "25e659a4bb38e810ebc252e53b5814ff908a8c58c2a9ce2fae1bbec24cbf4e20"
630
628
  dependencies = [
631
629
  "memchr",
632
630
  "serde",
@@ -634,31 +632,33 @@ dependencies = [
634
632
 
635
633
  [[package]]
636
634
  name = "itoa"
637
- version = "1.0.17"
635
+ version = "1.0.18"
638
636
  source = "registry+https://github.com/rust-lang/crates.io-index"
639
- checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2"
637
+ checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
640
638
 
641
639
  [[package]]
642
640
  name = "js-sys"
643
- version = "0.3.85"
641
+ version = "0.3.94"
644
642
  source = "registry+https://github.com/rust-lang/crates.io-index"
645
- checksum = "8c942ebf8e95485ca0d52d97da7c5a2c387d0e7f0ba4c35e93bfcaee045955b3"
643
+ checksum = "2e04e2ef80ce82e13552136fabeef8a5ed1f985a96805761cbb9a2c34e7664d9"
646
644
  dependencies = [
645
+ "cfg-if",
646
+ "futures-util",
647
647
  "once_cell",
648
648
  "wasm-bindgen",
649
649
  ]
650
650
 
651
651
  [[package]]
652
652
  name = "libc"
653
- version = "0.2.180"
653
+ version = "0.2.184"
654
654
  source = "registry+https://github.com/rust-lang/crates.io-index"
655
- checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc"
655
+ checksum = "48f5d2a454e16a5ea0f4ced81bd44e4cfc7bd3a507b61887c99fd3538b28e4af"
656
656
 
657
657
  [[package]]
658
658
  name = "litemap"
659
- version = "0.8.1"
659
+ version = "0.8.2"
660
660
  source = "registry+https://github.com/rust-lang/crates.io-index"
661
- checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77"
661
+ checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0"
662
662
 
663
663
  [[package]]
664
664
  name = "lock_api"
@@ -692,9 +692,9 @@ checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154"
692
692
 
693
693
  [[package]]
694
694
  name = "markup5ever"
695
- version = "0.38.0"
695
+ version = "0.39.0"
696
696
  source = "registry+https://github.com/rust-lang/crates.io-index"
697
- checksum = "8983d30f2915feeaaab2d6babdd6bc7e9ed1a00b66b5e6d74df19aa9c0e91862"
697
+ checksum = "7122d987ec5f704ee56f6e5b41a7d93722e9aae27ae07cafa4036c4d3f9757de"
698
698
  dependencies = [
699
699
  "log",
700
700
  "tendril",
@@ -709,9 +709,9 @@ checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79"
709
709
 
710
710
  [[package]]
711
711
  name = "mio"
712
- version = "1.1.1"
712
+ version = "1.2.0"
713
713
  source = "registry+https://github.com/rust-lang/crates.io-index"
714
- checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc"
714
+ checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1"
715
715
  dependencies = [
716
716
  "libc",
717
717
  "wasi",
@@ -735,9 +735,9 @@ dependencies = [
735
735
 
736
736
  [[package]]
737
737
  name = "once_cell"
738
- version = "1.21.3"
738
+ version = "1.21.4"
739
739
  source = "registry+https://github.com/rust-lang/crates.io-index"
740
- checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
740
+ checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
741
741
 
742
742
  [[package]]
743
743
  name = "parking_lot"
@@ -823,15 +823,9 @@ dependencies = [
823
823
 
824
824
  [[package]]
825
825
  name = "pin-project-lite"
826
- version = "0.2.16"
827
- source = "registry+https://github.com/rust-lang/crates.io-index"
828
- checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b"
829
-
830
- [[package]]
831
- name = "pin-utils"
832
- version = "0.1.0"
826
+ version = "0.2.17"
833
827
  source = "registry+https://github.com/rust-lang/crates.io-index"
834
- checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
828
+ checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
835
829
 
836
830
  [[package]]
837
831
  name = "portable-atomic"
@@ -841,9 +835,9 @@ checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49"
841
835
 
842
836
  [[package]]
843
837
  name = "potential_utf"
844
- version = "0.1.4"
838
+ version = "0.1.5"
845
839
  source = "registry+https://github.com/rust-lang/crates.io-index"
846
- checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77"
840
+ checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564"
847
841
  dependencies = [
848
842
  "zerovec",
849
843
  ]
@@ -874,9 +868,9 @@ dependencies = [
874
868
 
875
869
  [[package]]
876
870
  name = "pyo3"
877
- version = "0.28.0"
871
+ version = "0.28.3"
878
872
  source = "registry+https://github.com/rust-lang/crates.io-index"
879
- checksum = "fcf3ccafdf54c050be48a3a086d372f77ba6615f5057211607cd30e5ac5cec6d"
873
+ checksum = "91fd8e38a3b50ed1167fb981cd6fd60147e091784c427b8f7183a7ee32c31c12"
880
874
  dependencies = [
881
875
  "libc",
882
876
  "once_cell",
@@ -888,9 +882,9 @@ dependencies = [
888
882
 
889
883
  [[package]]
890
884
  name = "pyo3-build-config"
891
- version = "0.28.0"
885
+ version = "0.28.3"
892
886
  source = "registry+https://github.com/rust-lang/crates.io-index"
893
- checksum = "972720a441c91fd9c49f212a1d2d74c6e3803b231ebc8d66c51efbd7ccab11c8"
887
+ checksum = "e368e7ddfdeb98c9bca7f8383be1648fd84ab466bf2bc015e94008db6d35611e"
894
888
  dependencies = [
895
889
  "target-lexicon",
896
890
  ]
@@ -903,9 +897,9 @@ checksum = "4bf83fcee540452241ba030140f50418b973e840a64727c967b9266660f0a690"
903
897
 
904
898
  [[package]]
905
899
  name = "pyo3-ffi"
906
- version = "0.28.0"
900
+ version = "0.28.3"
907
901
  source = "registry+https://github.com/rust-lang/crates.io-index"
908
- checksum = "5994456d9dab8934d600d3867571b6410f24fbd6002570ad56356733eb54859b"
902
+ checksum = "7f29e10af80b1f7ccaf7f69eace800a03ecd13e883acfacc1e5d0988605f651e"
909
903
  dependencies = [
910
904
  "libc",
911
905
  "pyo3-build-config",
@@ -913,9 +907,9 @@ dependencies = [
913
907
 
914
908
  [[package]]
915
909
  name = "pyo3-macros"
916
- version = "0.28.0"
910
+ version = "0.28.3"
917
911
  source = "registry+https://github.com/rust-lang/crates.io-index"
918
- checksum = "11ce9cc8d81b3c4969748807604d92b4eef363c5bb82b1a1bdb34ec6f1093a18"
912
+ checksum = "df6e520eff47c45997d2fc7dd8214b25dd1310918bbb2642156ef66a67f29813"
919
913
  dependencies = [
920
914
  "proc-macro2",
921
915
  "pyo3-macros-backend",
@@ -925,9 +919,9 @@ dependencies = [
925
919
 
926
920
  [[package]]
927
921
  name = "pyo3-macros-backend"
928
- version = "0.28.0"
922
+ version = "0.28.3"
929
923
  source = "registry+https://github.com/rust-lang/crates.io-index"
930
- checksum = "eaf4b60036a154d23282679b658e3cc7d88d3b8c9a40b43824785f232d2e1b98"
924
+ checksum = "c4cdc218d835738f81c2338f822078af45b4afdf8b2e33cbb5916f108b813acb"
931
925
  dependencies = [
932
926
  "heck",
933
927
  "proc-macro2",
@@ -958,9 +952,9 @@ dependencies = [
958
952
 
959
953
  [[package]]
960
954
  name = "quinn-proto"
961
- version = "0.11.13"
955
+ version = "0.11.14"
962
956
  source = "registry+https://github.com/rust-lang/crates.io-index"
963
- checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31"
957
+ checksum = "434b42fec591c96ef50e21e886936e66d3cc3f737104fdb9b737c40ffb94c098"
964
958
  dependencies = [
965
959
  "bytes",
966
960
  "getrandom 0.3.4",
@@ -993,9 +987,9 @@ dependencies = [
993
987
 
994
988
  [[package]]
995
989
  name = "quote"
996
- version = "1.0.44"
990
+ version = "1.0.45"
997
991
  source = "registry+https://github.com/rust-lang/crates.io-index"
998
- checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4"
992
+ checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924"
999
993
  dependencies = [
1000
994
  "proc-macro2",
1001
995
  ]
@@ -1120,9 +1114,9 @@ dependencies = [
1120
1114
 
1121
1115
  [[package]]
1122
1116
  name = "rustc-hash"
1123
- version = "2.1.1"
1117
+ version = "2.1.2"
1124
1118
  source = "registry+https://github.com/rust-lang/crates.io-index"
1125
- checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
1119
+ checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe"
1126
1120
 
1127
1121
  [[package]]
1128
1122
  name = "rustc_version"
@@ -1135,9 +1129,9 @@ dependencies = [
1135
1129
 
1136
1130
  [[package]]
1137
1131
  name = "rustls"
1138
- version = "0.23.36"
1132
+ version = "0.23.37"
1139
1133
  source = "registry+https://github.com/rust-lang/crates.io-index"
1140
- checksum = "c665f33d38cea657d9614f766881e4d510e0eda4239891eea56b4cadcf01801b"
1134
+ checksum = "758025cb5fccfd3bc2fd74708fd4682be41d99e5dff73c377c0646c6012c73a4"
1141
1135
  dependencies = [
1142
1136
  "once_cell",
1143
1137
  "ring",
@@ -1159,9 +1153,9 @@ dependencies = [
1159
1153
 
1160
1154
  [[package]]
1161
1155
  name = "rustls-webpki"
1162
- version = "0.103.9"
1156
+ version = "0.103.10"
1163
1157
  source = "registry+https://github.com/rust-lang/crates.io-index"
1164
- checksum = "d7df23109aa6c1567d1c575b9952556388da57401e4ace1d15f79eedad0d8f53"
1158
+ checksum = "df33b2b81ac578cabaf06b89b0631153a3f416b0a886e8a7a1707fb51abbd1ef"
1165
1159
  dependencies = [
1166
1160
  "ring",
1167
1161
  "rustls-pki-types",
@@ -1176,9 +1170,9 @@ checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
1176
1170
 
1177
1171
  [[package]]
1178
1172
  name = "ryu"
1179
- version = "1.0.22"
1173
+ version = "1.0.23"
1180
1174
  source = "registry+https://github.com/rust-lang/crates.io-index"
1181
- checksum = "a50f4cf475b65d88e057964e0e9bb1f0aa9bbb2036dc65c64596b42932536984"
1175
+ checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f"
1182
1176
 
1183
1177
  [[package]]
1184
1178
  name = "scopeguard"
@@ -1188,9 +1182,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
1188
1182
 
1189
1183
  [[package]]
1190
1184
  name = "selectors"
1191
- version = "0.35.0"
1185
+ version = "0.36.1"
1192
1186
  source = "registry+https://github.com/rust-lang/crates.io-index"
1193
- checksum = "93fdfed56cd634f04fe8b9ddf947ae3dc493483e819593d2ba17df9ad05db8b2"
1187
+ checksum = "c5d9c0c92a92d33f08817311cf3f2c29a3538a8240e94a6a3c622ce652d7e00c"
1194
1188
  dependencies = [
1195
1189
  "bitflags",
1196
1190
  "cssparser",
@@ -1314,12 +1308,12 @@ checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
1314
1308
 
1315
1309
  [[package]]
1316
1310
  name = "socket2"
1317
- version = "0.6.2"
1311
+ version = "0.6.3"
1318
1312
  source = "registry+https://github.com/rust-lang/crates.io-index"
1319
- checksum = "86f4aa3ad99f2088c990dfa82d367e19cb29268ed67c574d10d0a4bfe71f07e0"
1313
+ checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e"
1320
1314
  dependencies = [
1321
1315
  "libc",
1322
- "windows-sys 0.60.2",
1316
+ "windows-sys 0.61.2",
1323
1317
  ]
1324
1318
 
1325
1319
  [[package]]
@@ -1360,9 +1354,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
1360
1354
 
1361
1355
  [[package]]
1362
1356
  name = "syn"
1363
- version = "2.0.114"
1357
+ version = "2.0.117"
1364
1358
  source = "registry+https://github.com/rust-lang/crates.io-index"
1365
- checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a"
1359
+ checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99"
1366
1360
  dependencies = [
1367
1361
  "proc-macro2",
1368
1362
  "quote",
@@ -1391,9 +1385,9 @@ dependencies = [
1391
1385
 
1392
1386
  [[package]]
1393
1387
  name = "target-lexicon"
1394
- version = "0.13.4"
1388
+ version = "0.13.5"
1395
1389
  source = "registry+https://github.com/rust-lang/crates.io-index"
1396
- checksum = "b1dd07eb858a2067e2f3c7155d54e929265c264e6f37efe3ee7a8d1b5a1dd0ba"
1390
+ checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
1397
1391
 
1398
1392
  [[package]]
1399
1393
  name = "tendril"
@@ -1427,9 +1421,9 @@ dependencies = [
1427
1421
 
1428
1422
  [[package]]
1429
1423
  name = "tinystr"
1430
- version = "0.8.2"
1424
+ version = "0.8.3"
1431
1425
  source = "registry+https://github.com/rust-lang/crates.io-index"
1432
- checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869"
1426
+ checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d"
1433
1427
  dependencies = [
1434
1428
  "displaydoc",
1435
1429
  "zerovec",
@@ -1437,9 +1431,9 @@ dependencies = [
1437
1431
 
1438
1432
  [[package]]
1439
1433
  name = "tinyvec"
1440
- version = "1.10.0"
1434
+ version = "1.11.0"
1441
1435
  source = "registry+https://github.com/rust-lang/crates.io-index"
1442
- checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa"
1436
+ checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3"
1443
1437
  dependencies = [
1444
1438
  "tinyvec_macros",
1445
1439
  ]
@@ -1452,9 +1446,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
1452
1446
 
1453
1447
  [[package]]
1454
1448
  name = "tokio"
1455
- version = "1.49.0"
1449
+ version = "1.50.0"
1456
1450
  source = "registry+https://github.com/rust-lang/crates.io-index"
1457
- checksum = "72a2903cd7736441aac9df9d7688bd0ce48edccaadf181c3b90be801e81d3d86"
1451
+ checksum = "27ad5e34374e03cfffefc301becb44e9dc3c17584f414349ebe29ed26661822d"
1458
1452
  dependencies = [
1459
1453
  "bytes",
1460
1454
  "libc",
@@ -1587,9 +1581,9 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
1587
1581
 
1588
1582
  [[package]]
1589
1583
  name = "unicode-ident"
1590
- version = "1.0.22"
1584
+ version = "1.0.24"
1591
1585
  source = "registry+https://github.com/rust-lang/crates.io-index"
1592
- checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5"
1586
+ checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
1593
1587
 
1594
1588
  [[package]]
1595
1589
  name = "untrusted"
@@ -1647,9 +1641,9 @@ dependencies = [
1647
1641
 
1648
1642
  [[package]]
1649
1643
  name = "wasm-bindgen"
1650
- version = "0.2.108"
1644
+ version = "0.2.117"
1651
1645
  source = "registry+https://github.com/rust-lang/crates.io-index"
1652
- checksum = "64024a30ec1e37399cf85a7ffefebdb72205ca1c972291c51512360d90bd8566"
1646
+ checksum = "0551fc1bb415591e3372d0bc4780db7e587d84e2a7e79da121051c5c4b89d0b0"
1653
1647
  dependencies = [
1654
1648
  "cfg-if",
1655
1649
  "once_cell",
@@ -1660,23 +1654,19 @@ dependencies = [
1660
1654
 
1661
1655
  [[package]]
1662
1656
  name = "wasm-bindgen-futures"
1663
- version = "0.4.58"
1657
+ version = "0.4.67"
1664
1658
  source = "registry+https://github.com/rust-lang/crates.io-index"
1665
- checksum = "70a6e77fd0ae8029c9ea0063f87c46fde723e7d887703d74ad2616d792e51e6f"
1659
+ checksum = "03623de6905b7206edd0a75f69f747f134b7f0a2323392d664448bf2d3c5d87e"
1666
1660
  dependencies = [
1667
- "cfg-if",
1668
- "futures-util",
1669
1661
  "js-sys",
1670
- "once_cell",
1671
1662
  "wasm-bindgen",
1672
- "web-sys",
1673
1663
  ]
1674
1664
 
1675
1665
  [[package]]
1676
1666
  name = "wasm-bindgen-macro"
1677
- version = "0.2.108"
1667
+ version = "0.2.117"
1678
1668
  source = "registry+https://github.com/rust-lang/crates.io-index"
1679
- checksum = "008b239d9c740232e71bd39e8ef6429d27097518b6b30bdf9086833bd5b6d608"
1669
+ checksum = "7fbdf9a35adf44786aecd5ff89b4563a90325f9da0923236f6104e603c7e86be"
1680
1670
  dependencies = [
1681
1671
  "quote",
1682
1672
  "wasm-bindgen-macro-support",
@@ -1684,9 +1674,9 @@ dependencies = [
1684
1674
 
1685
1675
  [[package]]
1686
1676
  name = "wasm-bindgen-macro-support"
1687
- version = "0.2.108"
1677
+ version = "0.2.117"
1688
1678
  source = "registry+https://github.com/rust-lang/crates.io-index"
1689
- checksum = "5256bae2d58f54820e6490f9839c49780dff84c65aeab9e772f15d5f0e913a55"
1679
+ checksum = "dca9693ef2bab6d4e6707234500350d8dad079eb508dca05530c85dc3a529ff2"
1690
1680
  dependencies = [
1691
1681
  "bumpalo",
1692
1682
  "proc-macro2",
@@ -1697,18 +1687,18 @@ dependencies = [
1697
1687
 
1698
1688
  [[package]]
1699
1689
  name = "wasm-bindgen-shared"
1700
- version = "0.2.108"
1690
+ version = "0.2.117"
1701
1691
  source = "registry+https://github.com/rust-lang/crates.io-index"
1702
- checksum = "1f01b580c9ac74c8d8f0c0e4afb04eeef2acf145458e52c03845ee9cd23e3d12"
1692
+ checksum = "39129a682a6d2d841b6c429d0c51e5cb0ed1a03829d8b3d1e69a011e62cb3d3b"
1703
1693
  dependencies = [
1704
1694
  "unicode-ident",
1705
1695
  ]
1706
1696
 
1707
1697
  [[package]]
1708
1698
  name = "web-sys"
1709
- version = "0.3.85"
1699
+ version = "0.3.94"
1710
1700
  source = "registry+https://github.com/rust-lang/crates.io-index"
1711
- checksum = "312e32e551d92129218ea9a2452120f4aabc03529ef03e4d0d82fb2780608598"
1701
+ checksum = "cd70027e39b12f0849461e08ffc50b9cd7688d942c1c8e3c7b22273236b4dd0a"
1712
1702
  dependencies = [
1713
1703
  "js-sys",
1714
1704
  "wasm-bindgen",
@@ -1962,9 +1952,9 @@ checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650"
1962
1952
 
1963
1953
  [[package]]
1964
1954
  name = "winnow"
1965
- version = "0.7.14"
1955
+ version = "0.7.15"
1966
1956
  source = "registry+https://github.com/rust-lang/crates.io-index"
1967
- checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829"
1957
+ checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945"
1968
1958
  dependencies = [
1969
1959
  "memchr",
1970
1960
  ]
@@ -1983,9 +1973,9 @@ checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9"
1983
1973
 
1984
1974
  [[package]]
1985
1975
  name = "yoke"
1986
- version = "0.8.1"
1976
+ version = "0.8.2"
1987
1977
  source = "registry+https://github.com/rust-lang/crates.io-index"
1988
- checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954"
1978
+ checksum = "abe8c5fda708d9ca3df187cae8bfb9ceda00dd96231bed36e445a1a48e66f9ca"
1989
1979
  dependencies = [
1990
1980
  "stable_deref_trait",
1991
1981
  "yoke-derive",
@@ -1994,9 +1984,9 @@ dependencies = [
1994
1984
 
1995
1985
  [[package]]
1996
1986
  name = "yoke-derive"
1997
- version = "0.8.1"
1987
+ version = "0.8.2"
1998
1988
  source = "registry+https://github.com/rust-lang/crates.io-index"
1999
- checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d"
1989
+ checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e"
2000
1990
  dependencies = [
2001
1991
  "proc-macro2",
2002
1992
  "quote",
@@ -2006,18 +1996,18 @@ dependencies = [
2006
1996
 
2007
1997
  [[package]]
2008
1998
  name = "zerocopy"
2009
- version = "0.8.39"
1999
+ version = "0.8.48"
2010
2000
  source = "registry+https://github.com/rust-lang/crates.io-index"
2011
- checksum = "db6d35d663eadb6c932438e763b262fe1a70987f9ae936e60158176d710cae4a"
2001
+ checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9"
2012
2002
  dependencies = [
2013
2003
  "zerocopy-derive",
2014
2004
  ]
2015
2005
 
2016
2006
  [[package]]
2017
2007
  name = "zerocopy-derive"
2018
- version = "0.8.39"
2008
+ version = "0.8.48"
2019
2009
  source = "registry+https://github.com/rust-lang/crates.io-index"
2020
- checksum = "4122cd3169e94605190e77839c9a40d40ed048d305bfdc146e7df40ab0f3e517"
2010
+ checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4"
2021
2011
  dependencies = [
2022
2012
  "proc-macro2",
2023
2013
  "quote",
@@ -2026,18 +2016,18 @@ dependencies = [
2026
2016
 
2027
2017
  [[package]]
2028
2018
  name = "zerofrom"
2029
- version = "0.1.6"
2019
+ version = "0.1.7"
2030
2020
  source = "registry+https://github.com/rust-lang/crates.io-index"
2031
- checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5"
2021
+ checksum = "69faa1f2a1ea75661980b013019ed6687ed0e83d069bc1114e2cc74c6c04c4df"
2032
2022
  dependencies = [
2033
2023
  "zerofrom-derive",
2034
2024
  ]
2035
2025
 
2036
2026
  [[package]]
2037
2027
  name = "zerofrom-derive"
2038
- version = "0.1.6"
2028
+ version = "0.1.7"
2039
2029
  source = "registry+https://github.com/rust-lang/crates.io-index"
2040
- checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502"
2030
+ checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1"
2041
2031
  dependencies = [
2042
2032
  "proc-macro2",
2043
2033
  "quote",
@@ -2053,9 +2043,9 @@ checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0"
2053
2043
 
2054
2044
  [[package]]
2055
2045
  name = "zerotrie"
2056
- version = "0.2.3"
2046
+ version = "0.2.4"
2057
2047
  source = "registry+https://github.com/rust-lang/crates.io-index"
2058
- checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851"
2048
+ checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf"
2059
2049
  dependencies = [
2060
2050
  "displaydoc",
2061
2051
  "yoke",
@@ -2064,9 +2054,9 @@ dependencies = [
2064
2054
 
2065
2055
  [[package]]
2066
2056
  name = "zerovec"
2067
- version = "0.11.5"
2057
+ version = "0.11.6"
2068
2058
  source = "registry+https://github.com/rust-lang/crates.io-index"
2069
- checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002"
2059
+ checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239"
2070
2060
  dependencies = [
2071
2061
  "yoke",
2072
2062
  "zerofrom",
@@ -2075,9 +2065,9 @@ dependencies = [
2075
2065
 
2076
2066
  [[package]]
2077
2067
  name = "zerovec-derive"
2078
- version = "0.11.2"
2068
+ version = "0.11.3"
2079
2069
  source = "registry+https://github.com/rust-lang/crates.io-index"
2080
- checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3"
2070
+ checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555"
2081
2071
  dependencies = [
2082
2072
  "proc-macro2",
2083
2073
  "quote",
@@ -2086,6 +2076,6 @@ dependencies = [
2086
2076
 
2087
2077
  [[package]]
2088
2078
  name = "zmij"
2089
- version = "1.0.19"
2079
+ version = "1.0.21"
2090
2080
  source = "registry+https://github.com/rust-lang/crates.io-index"
2091
- checksum = "3ff05f8caa9038894637571ae6b9e29466c1f4f829d26c9b28f869a29cbe3445"
2081
+ checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa"
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "css-inline-python"
3
- version = "0.20.0"
3
+ version = "0.20.2"
4
4
  authors = ["Dmitry Dygalo <dmitry@dygalo.dev>"]
5
5
  edition = "2024"
6
6
  rust-version = "1.85"
@@ -90,7 +90,7 @@ inlined = css_inline.inline(HTML)
90
90
 
91
91
  Note that `css-inline` automatically adds missing `html` and `body` tags, so the output is a valid HTML document.
92
92
 
93
- Alternatively, you can inline CSS into an HTML fragment, preserving the original structure:
93
+ Alternatively, you can inline CSS into an HTML fragment. Structural tags (`<html>`, `<head>`, `<body>`) are stripped from the output; only their contents are preserved. Use `inline` if you need to keep the full document structure:
94
94
 
95
95
  ```python
96
96
  FRAGMENT = """<main>
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "css-inline"
3
- version = "0.20.0"
3
+ version = "0.20.2"
4
4
  authors = ["Dmitry Dygalo <dmitry@dygalo.dev>"]
5
5
  edition = "2021"
6
6
  license = "MIT"
@@ -18,9 +18,6 @@ exclude = [
18
18
  categories = ["web-programming"]
19
19
  rust-version = "1.80"
20
20
 
21
- [[bin]]
22
- name = "css-inline"
23
-
24
21
  [features]
25
22
  default = ["cli", "http", "file", "stylesheet-cache"]
26
23
  cli = ["rayon"]
@@ -30,14 +27,14 @@ stylesheet-cache = ["lru"]
30
27
 
31
28
  [dependencies]
32
29
  cssparser = "0.36.0"
33
- html5ever = "0.38.0"
30
+ html5ever = "0.39.0"
34
31
  lru = { version = "0.16.0", optional = true }
35
32
  memchr = "2.7"
36
33
  precomputed-hash = "0.1.1"
37
34
  rayon = { version = "1.10", optional = true }
38
35
  reqwest = { version = "0.12.0", optional = true, default-features = false, features = ["rustls-tls", "blocking"] }
39
36
  rustc-hash = "2.0.0"
40
- selectors = "0.35.0"
37
+ selectors = "0.36.1"
41
38
  smallvec = "1"
42
39
  url = "2"
43
40
 
@@ -43,6 +43,7 @@ into:
43
43
  - Works on Linux, Windows, and macOS
44
44
  - Supports HTML5 & CSS3
45
45
  - Bindings for [Python](https://github.com/Stranger6667/css-inline/tree/master/bindings/python), [Ruby](https://github.com/Stranger6667/css-inline/tree/master/bindings/ruby), [JavaScript](https://github.com/Stranger6667/css-inline/tree/master/bindings/javascript), [Java](https://github.com/Stranger6667/css-inline/tree/master/bindings/java), [C](https://github.com/Stranger6667/css-inline/tree/master/bindings/c), [PHP](https://github.com/Stranger6667/css-inline/tree/master/bindings/php), and a [WebAssembly](https://github.com/Stranger6667/css-inline/tree/master/bindings/javascript/wasm) module to run in browsers.
46
+ - [Elixir bindings](https://github.com/knocklabs/css_inline) maintained by [Knock](https://github.com/knocklabs)
46
47
  - Command Line Interface
47
48
 
48
49
  ## Playground
@@ -81,7 +82,7 @@ fn main() -> css_inline::Result<()> {
81
82
 
82
83
  Note that `css-inline` automatically adds missing `html` and `body` tags, so the output is a valid HTML document.
83
84
 
84
- Alternatively, you can inline CSS into an HTML fragment, preserving the original structure:
85
+ Alternatively, you can inline CSS into an HTML fragment. Structural tags (`<html>`, `<head>`, `<body>`) are stripped from the output; only their contents are preserved. Use `inline` if you need to keep the full document structure:
85
86
 
86
87
  ```rust
87
88
  const FRAGMENT: &str = r#"<main>
@@ -284,10 +284,10 @@ impl Document {
284
284
 
285
285
  /// Remove all the children from node and append them to `new_parent`.
286
286
  pub(super) fn reparent_children(&mut self, node: NodeId, new_parent: NodeId) {
287
- let mut next_child = self[node].first_child;
288
- while let Some(child) = next_child {
287
+ // Re-read `first_child` each iteration: `append` calls `detach` internally, which clears
288
+ // `child.next_sibling` and updates `node.first_child` to the former second child.
289
+ while let Some(child) = self[node].first_child {
289
290
  self.append(new_parent, child);
290
- next_child = self[child].next_sibling;
291
291
  }
292
292
  }
293
293
 
@@ -700,6 +700,11 @@ fn merge_styles<Wr: Write>(
700
700
  let current_declarations_count = parsed_declarations_count;
701
701
  // Next, we iterate over the new styles and merge them into our existing set
702
702
  // New rules will not override old ones unless they are marked as `!important`
703
+ let sep = if minify_css {
704
+ STYLE_SEPARATOR_MIN
705
+ } else {
706
+ STYLE_SEPARATOR
707
+ };
703
708
  for (property, _, value) in new_styles {
704
709
  match (
705
710
  value.trim_end().strip_suffix("!important"),
@@ -708,8 +713,8 @@ fn merge_styles<Wr: Write>(
708
713
  .take(parsed_declarations_count)
709
714
  .find(|style| {
710
715
  style.starts_with(property.as_bytes())
711
- && style.get(property.len()..=property.len().saturating_add(1))
712
- == Some(STYLE_SEPARATOR)
716
+ && style.get(property.len()..property.len().saturating_add(sep.len()))
717
+ == Some(sep)
713
718
  }),
714
719
  ) {
715
720
  // The new rule is `!important` and there's an existing rule with the same name
@@ -717,13 +722,12 @@ fn merge_styles<Wr: Write>(
717
722
  // Per CSS spec: inline `!important` takes precedence over stylesheet `!important`
718
723
  (Some(value), Some(buffer)) => {
719
724
  if !buffer.ends_with(b"!important") {
720
- // We keep the rule name and the colon-space suffix - '<rule>: `
721
- buffer.truncate(property.len().saturating_add(STYLE_SEPARATOR.len()));
725
+ buffer.truncate(property.len().saturating_add(sep.len()));
722
726
  write_declaration_value(buffer, value)?;
727
+ buffer.extend_from_slice(b" !important");
723
728
  }
724
729
  }
725
730
  // There's no existing rule with the same name, but the new rule is `!important`
726
- // In this case, we add the new rule with the `!important` suffix removed
727
731
  (Some(value), None) => {
728
732
  push_or_update!(
729
733
  declarations_buffer,
@@ -732,6 +736,13 @@ fn merge_styles<Wr: Write>(
732
736
  value,
733
737
  minify_css
734
738
  );
739
+ // `push_or_update!` increments `parsed_declarations_count`, so subtract 1
740
+ // to get the slot that was just written and append the `!important` suffix.
741
+ if let Some(buf) =
742
+ declarations_buffer.get_mut(parsed_declarations_count.saturating_sub(1))
743
+ {
744
+ buf.extend_from_slice(b" !important");
745
+ }
735
746
  }
736
747
  // There's no existing rule with the same name, and the new rule is not `!important`
737
748
  // In this case, we just add the new rule as-is
@@ -589,6 +589,14 @@ impl<'a> CSSInliner<'a> {
589
589
 
590
590
  /// Inline CSS into an HTML fragment.
591
591
  ///
592
+ /// Unlike [`inline`](CSSInliner::inline), this method does not wrap the output in `<html>` and
593
+ /// `<body>` tags. Structural tags (`<html>`, `<head>`, `<body>`) are stripped from the output;
594
+ /// only their contents are preserved. CSS from `<style>` tags within the input is also
595
+ /// processed and inlined.
596
+ ///
597
+ /// If you need to preserve the full HTML document structure, use [`inline`](CSSInliner::inline)
598
+ /// instead.
599
+ ///
592
600
  /// # Errors
593
601
  ///
594
602
  /// Inlining might fail for the following reasons:
@@ -609,6 +617,8 @@ impl<'a> CSSInliner<'a> {
609
617
 
610
618
  /// Inline CSS into an HTML fragment and write the result to a generic writer.
611
619
  ///
620
+ /// See [`inline_fragment`](CSSInliner::inline_fragment) for details on fragment handling.
621
+ ///
612
622
  /// # Errors
613
623
  ///
614
624
  /// Inlining might fail for the following reasons:
@@ -939,6 +949,8 @@ pub fn inline_to<W: Write>(html: &str, target: &mut W) -> Result<()> {
939
949
 
940
950
  /// Shortcut for inlining CSS into an HTML fragment with default parameters.
941
951
  ///
952
+ /// See [`CSSInliner::inline_fragment`] for details on fragment handling.
953
+ ///
942
954
  /// # Errors
943
955
  ///
944
956
  /// Inlining might fail for the following reasons:
File without changes
File without changes