mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-14 19:26:56 -04:00
SVG import: no slice indexing when writing a new style attribute
This commit is contained in:
1 parent
5f8c4e9ab5
commit
6f9595542d
1 file changed
+1
-1
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user