diff options
author | Dan Davison <dandavison7@gmail.com> | 2020-05-27 21:00:20 -0400 |
---|---|---|
committer | Dan Davison <dandavison7@gmail.com> | 2020-05-27 21:00:20 -0400 |
commit | dc3b9dbf08d3821942b6608524f6db4464ce081b (patch) | |
tree | 4f02ae2b2c12cda96feafd12c83f9ea54ce457c5 /src/style.rs | |
parent | 71c32c8628daf0dde3219bee7a678e57ed3ecd24 (diff) |
Be more permissive: take first of multiple special attributes
Diffstat (limited to 'src/style.rs')
-rw-r--r-- | src/style.rs | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/style.rs b/src/style.rs index c015a7a0..746a391e 100644 --- a/src/style.rs +++ b/src/style.rs @@ -288,16 +288,10 @@ fn extract_special_decoration_attribute(style_string: &str) -> (String, Option<S }); match special_attributes { attrs if attrs.len() == 0 => (style_string.to_string(), None), - attrs if attrs.len() == 1 => (standard_attributes.join(" "), Some(attrs[0].to_string())), - attrs => { - eprintln!( - "Encountered multiple special attributes: {:?}. \ - You may supply no more than one of the special attributes 'box', 'underline', \ - and 'omit'.", - attrs.join(", ") - ); - process::exit(1); - } + attrs => ( + format!("{} {}", attrs[1..].join(" "), standard_attributes.join(" ")), + Some(attrs[0].to_string()), + ), } } |