diff --git a/crates/svg/src/import/css.rs b/crates/svg/src/import/css.rs index 3593a870b..fd864a547 100644 --- a/crates/svg/src/import/css.rs +++ b/crates/svg/src/import/css.rs @@ -18,7 +18,8 @@ pub(super) type XNode<'a, 'i> = roxmltree::Node<'a, 'i>; /// `name: value` declarations of a block or `style` attribute, with their `!important` flag. The /// `font` shorthand becomes its longhands, as usvg reads it for the rest of the drawing (#1557). pub(super) fn parse_decls(s: &str) -> Vec<(String, String, bool)> { - split_decls(s) + let s = strip_comments(s); + split_decls(&s) .into_iter() .filter_map(|d| { let (k, v) = d.split_once(':')?; @@ -354,9 +355,8 @@ fn top_level_commas(list: &str) -> impl Iterator { }) } -/// Rules from every `