From 6f9595542d359f1dbf57de1579b09ac3236f88c9 Mon Sep 17 00:00:00 2001 From: Gert Pellin Date: Tue, 13 Oct 2026 21:59:00 +0200 Subject: [PATCH] SVG import: no slice indexing when writing a new style attribute --- crates/svg/src/import.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/svg/src/import.rs b/crates/svg/src/import.rs index 231963e3..323621e1 100644 --- a/crates/svg/src/import.rs +++ b/crates/svg/src/import.rs @@ -524,7 +524,7 @@ impl Edits { /// skipped. fn apply(mut self, svg: &str) -> Cow<'_, str> { for (at, has_style, decls) in std::mem::take(&mut self.styles).into_values() { - self.insert(at, if has_style { decls } else { format!(" style=\"{}\"", &decls[1..]) }); + self.insert(at, if has_style { decls } else { format!(" style=\"{}\"", decls.strip_prefix(';').unwrap_or(&decls)) }); } if self.list.is_empty() { return svg.into();