Skip to content

Commit b95ca96

Browse files
committed
Ensure properties are fully parsed, and fall back to custom
1 parent ac91a84 commit b95ca96

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,8 @@ mod tests {
305305
}
306306
"#
307307
});
308+
309+
minify_test(".foo { border-bottom: 1px solid var(--spectrum-global-color-gray-200)}", ".foo{border-bottom:1px solid var(--spectrum-global-color-gray-200)}");
308310
}
309311

310312
#[test]

src/properties/mod.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,19 @@ macro_rules! define_properties {
6666
$(
6767
$name => {
6868
if let Ok(c) = <$type>::parse(input) {
69-
return Ok(Property::$property(c, $(<$vp>::None)?))
69+
if input.expect_exhausted().is_ok() {
70+
return Ok(Property::$property(c, $(<$vp>::None)?))
71+
}
7072
}
7173
}
7274
)+
7375
$(
7476
$(
7577
concat!("-", $prefix, "-", $name) => {
7678
if let Ok(c) = <$type>::parse(input) {
77-
return Ok(Property::$property(c, VendorPrefix::from_str($prefix)))
79+
if input.expect_exhausted().is_ok() {
80+
return Ok(Property::$property(c, VendorPrefix::from_str($prefix)))
81+
}
7882
}
7983
}
8084
)*

0 commit comments

Comments
 (0)