diff --git a/crates/usvg/src/parser/svgtree/mod.rs b/crates/usvg/src/parser/svgtree/mod.rs index 30308dcb8..3591fd8f3 100644 --- a/crates/usvg/src/parser/svgtree/mod.rs +++ b/crates/usvg/src/parser/svgtree/mod.rs @@ -282,6 +282,23 @@ impl<'a, 'input: 'a> SvgNode<'a, 'input> { .iter() .find(|a| a.name == aid) .map(|a| a.value.as_str())?; + // These AId have an initial value of none + let is_possible_none = matches!( + aid, + AId::Mask + | AId::MarkerStart + | AId::MarkerMid + | AId::MarkerEnd + | AId::ClipPath + | AId::Filter + | AId::FontSizeAdjust + | AId::TextDecoration + | AId::Stroke + | AId::StrokeDasharray + ); + if is_possible_none && value == "none" { + return None; + } match T::parse(*self, aid, value) { Some(v) => Some(v), None => {