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/ext/css_inline/Cargo.toml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "css-inline-ruby"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.20.1"
|
|
4
4
|
authors = ["Dmitry Dygalo <dmitry@dygalo.dev>"]
|
|
5
5
|
edition = "2024"
|
|
6
6
|
readme = "README.rdoc"
|
|
@@ -20,6 +20,6 @@ magnus = "0.8"
|
|
|
20
20
|
rayon = "1"
|
|
21
21
|
|
|
22
22
|
[dependencies.css-inline]
|
|
23
|
-
version = "0.
|
|
23
|
+
version = "0.20.1"
|
|
24
24
|
default-features = false
|
|
25
25
|
features = ["http", "file", "stylesheet-cache"]
|
data/ext/css_inline/src/lib.rs
CHANGED
|
@@ -69,6 +69,10 @@ struct Options {
|
|
|
69
69
|
preallocate_node_capacity: Option<usize>,
|
|
70
70
|
/// Remove selectors that were successfully inlined from inline `<style>` blocks.
|
|
71
71
|
remove_inlined_selectors: Option<bool>,
|
|
72
|
+
/// Apply `width` HTML attributes from CSS `width` properties on supported elements.
|
|
73
|
+
apply_width_attributes: Option<bool>,
|
|
74
|
+
/// Apply `height` HTML attributes from CSS `height` properties on supported elements.
|
|
75
|
+
apply_height_attributes: Option<bool>,
|
|
72
76
|
}
|
|
73
77
|
|
|
74
78
|
impl TryConvert for Options {
|
|
@@ -90,6 +94,10 @@ impl TryConvert for Options {
|
|
|
90
94
|
.aref::<_, Option<usize>>(ruby.to_symbol("preallocate_node_capacity"))?,
|
|
91
95
|
remove_inlined_selectors: h
|
|
92
96
|
.aref::<_, Option<bool>>(ruby.to_symbol("remove_inlined_selectors"))?,
|
|
97
|
+
apply_width_attributes: h
|
|
98
|
+
.aref::<_, Option<bool>>(ruby.to_symbol("apply_width_attributes"))?,
|
|
99
|
+
apply_height_attributes: h
|
|
100
|
+
.aref::<_, Option<bool>>(ruby.to_symbol("apply_height_attributes"))?,
|
|
93
101
|
})
|
|
94
102
|
}
|
|
95
103
|
}
|
|
@@ -113,6 +121,8 @@ fn parse_options<Req>(
|
|
|
113
121
|
preallocate_node_capacity: kwargs.preallocate_node_capacity.unwrap_or(32),
|
|
114
122
|
resolver: Arc::new(rust_inline::DefaultStylesheetResolver),
|
|
115
123
|
remove_inlined_selectors: kwargs.remove_inlined_selectors.unwrap_or(false),
|
|
124
|
+
apply_width_attributes: kwargs.apply_width_attributes.unwrap_or(false),
|
|
125
|
+
apply_height_attributes: kwargs.apply_height_attributes.unwrap_or(false),
|
|
116
126
|
})
|
|
117
127
|
}
|
|
118
128
|
|
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.20.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dmitry Dygalo
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-03-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rb_sys
|