SVG import: no slice indexing when writing a new style attribute

This commit is contained in:
Gert Pellin authored and bflatastic committed 2026-10-14 05:16:00 +07:00
1 parent 5f8c4e9ab5
commit 6f9595542d
1 file changed
+1 -1
+1 -1
View File
@@ -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();