-
Notifications
You must be signed in to change notification settings - Fork 93
Group by style may produce ungroupable groups #72
Comments
You right. It's a bug. The problem is that you using a default The whole concept of hidden attributes a bit broken... I'll try to remove default attributes completely in hope it will help. |
Should be fixed by the latest commit. Try it out. |
Weird, I just wanted to run the new version on master and I get Even weirder, the error remains when I reset the git repository to the version 0.8 To make the error reproducible, this script ends with the above error message: #!/usr/bin/env bash
cd `mktemp -d`
wget -q https://github.com/RazrFalcon/svgcleaner/archive/v0.8.0.zip
unzip v0.8.0.zip
cd svgcleaner-0.8.0
cargo build
cat > input.svg <<- EOM
<svg height="50" width="50" viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg">
<ellipse cx="25" cy="25" rx="10" ry="10" style="fill:#000000" />
<ellipse cx="25" cy="25" rx="10" ry="10" style="fill:#000000" />
<ellipse cx="25" cy="25" rx="10" ry="10" style="fill:#000000" />
</svg>
EOM
./target/debug/svgcleaner input.svg output.svg Am I doing something wrong? As I said, my installed version works and it's 0.8 and just 3 days old: $ stat -c "%y" `which svgcleaner`; svgcleaner -V
2017-01-17 12:26:56.613874159 +0100
svgcleaner 0.8.0 |
Weird indeed. Try: |
So svgcleaner parses the CLI arguments correctly and handles the right input and output file, but parsing the input file fails. The problem seems to be purely in the svgdom crate. The following code using extern crate svgdom;
use svgdom::{Document, ParseOptions};
const DATA: &'static [u8] = br#"
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<rect x="25" y="25" width="200" height="200" fill="lime" stroke-width="4" stroke="pink" />
</svg>
"#;
fn main() {
Document::from_data_with_opt(DATA, &ParseOptions::default()).unwrap();
} |
Yes. It's Have no idea what can be wrong.
|
Okay this is very weird (but it's also weird that the I'm digging into this right now. For the standalone example in my previous comment, the error is produced by this line. The processed token stream is:
|
I think the |
Thank! After updating the Sadly, I can't fix bug in current version in crates. I'll fill a bug to the |
I tried the new version now and no more empty groups! The output of svgcleaner looks perfect now. Thank you! |
As the title suggests, in some cases the
--group-by-style
option may produce groups that should be ungrouped by svgcleaner (40cc1b7).Input
Output
svgcleaner --indent 2 --group-by-style true <files>
svgcleaner --indent 2 --group-by-style true --multipass true <files>
svgcleaner --indent 2 --group-by-style false <files>
One should expect
--multipass true
to fix this, but it keeps the group untouched.The text was updated successfully, but these errors were encountered: