css_inline 0.19.1 → 0.20.1
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 +159 -143
- data/README.md +3 -1
- data/ext/css_inline/Cargo.lock +159 -143
- data/ext/css_inline/Cargo.toml +2 -2
- data/ext/css_inline/src/lib.rs +10 -0
- metadata +2 -2
data/README.md
CHANGED
|
@@ -143,6 +143,8 @@ inliner.inline("...")
|
|
|
143
143
|
- `extra_css`. Extra CSS to be inlined. Default: `nil`
|
|
144
144
|
- `preallocate_node_capacity`. **Advanced**. Preallocates capacity for HTML nodes during parsing. This can improve performance when you have an estimate of the number of nodes in your HTML document. Default: `32`
|
|
145
145
|
- `remove_inlined_selectors`. Specifies whether to remove selectors that were successfully inlined from `<style>` blocks. Default: `false`
|
|
146
|
+
- `apply_width_attributes`. Specifies whether to add `width` HTML attributes from CSS `width` properties on supported elements (`table`, `td`, `th`, `img`). Default: `false`
|
|
147
|
+
- `apply_height_attributes`. Specifies whether to add `height` HTML attributes from CSS `height` properties on supported elements (`table`, `td`, `th`, `img`). Default: `false`
|
|
146
148
|
|
|
147
149
|
You can also skip CSS inlining for an HTML tag by adding the `data-css-inline="ignore"` attribute to it:
|
|
148
150
|
|
|
@@ -245,7 +247,7 @@ The table below shows benchmark results comparing `css_inline`, `roadie`, and `p
|
|
|
245
247
|
| Basic usage | 230 B | 6.07 µs | 173.50 µs (**28.60x**) | 345.30 µs (**56.91x**) |
|
|
246
248
|
| Realistic email 1 | 8.58 KB | 91.23 µs | 713.40 µs (**7.82x**) | 6.80 ms (**74.53x**) |
|
|
247
249
|
| Realistic email 2 | 4.3 KB | 57.56 µs | 1.99 ms (**34.56x**) | ERROR |
|
|
248
|
-
| GitHub Page | 1.81 MB |
|
|
250
|
+
| GitHub Page | 1.81 MB | 21.61 ms | 8.20 s (**379.45x**) | 2.40 s (**111.06x**) |
|
|
249
251
|
|
|
250
252
|
Please refer to the `test/bench.rb` file to review the benchmark code.
|
|
251
253
|
The results displayed above were measured using stable `rustc 1.91` on Ruby `3.4.7`.
|