Skip to content

Commit 072148a

Browse files
Don't emit warning for certain attributes with value none (#994)
1 parent 17cde9e commit 072148a

File tree

1 file changed

+17
-0
lines changed
  • crates/usvg/src/parser/svgtree

1 file changed

+17
-0
lines changed

crates/usvg/src/parser/svgtree/mod.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,23 @@ impl<'a, 'input: 'a> SvgNode<'a, 'input> {
282282
.iter()
283283
.find(|a| a.name == aid)
284284
.map(|a| a.value.as_str())?;
285+
// These AId have an initial value of none
286+
let is_possible_none = matches!(
287+
aid,
288+
AId::Mask
289+
| AId::MarkerStart
290+
| AId::MarkerMid
291+
| AId::MarkerEnd
292+
| AId::ClipPath
293+
| AId::Filter
294+
| AId::FontSizeAdjust
295+
| AId::TextDecoration
296+
| AId::Stroke
297+
| AId::StrokeDasharray
298+
);
299+
if is_possible_none && value == "none" {
300+
return None;
301+
}
285302
match T::parse(*self, aid, value) {
286303
Some(v) => Some(v),
287304
None => {

0 commit comments

Comments
 (0)