diff --git a/svg/svg.go b/svg/svg.go index a5a17eaf9..a586da3db 100644 --- a/svg/svg.go +++ b/svg/svg.go @@ -121,8 +121,6 @@ func (o *Minifier) Minify(m *minify.M, w io.Writer, r io.Reader, _ map[string]st tag = t.Hash if tag == Metadata { t.Data = nil - } else if tag == Rect { - o.shortenRect(tb, &t) } if t.Data == nil { @@ -261,22 +259,6 @@ func (o *Minifier) shortenDimension(b []byte) ([]byte, int) { return b, 0 } -func (o *Minifier) shortenRect(tb *TokenBuffer, t *Token) { - w, h := zeroBytes, zeroBytes - attrs := tb.Attributes(Width, Height) - if attrs[0] != nil { - n, _ := parse.Dimension(attrs[0].AttrVal) - w = minify.Number(attrs[0].AttrVal[:n], o.Precision) - } - if attrs[1] != nil { - n, _ := parse.Dimension(attrs[1].AttrVal) - h = minify.Number(attrs[1].AttrVal[:n], o.Precision) - } - if len(w) == 0 || w[0] == '0' || len(h) == 0 || h[0] == '0' { - t.Data = nil - } -} - //////////////////////////////////////////////////////////////// func printTag(w io.Writer, tb *TokenBuffer, tag Hash) { diff --git a/svg/svg_test.go b/svg/svg_test.go index f57b7647a..0107e4892 100644 --- a/svg/svg_test.go +++ b/svg/svg_test.go @@ -52,9 +52,7 @@ func TestSVG(t *testing.T) { {``, ``}, {``, ``}, {``, ``}, - {``, ``}, - {``, ``}, - {``, ``}, + {``, ``}, {``, ``}, {``, ``}, {``, ``}, @@ -69,8 +67,8 @@ func TestSVG(t *testing.T) { {``, ``}, // #45 {``, ``}, // #117 - {``, ``}, // #244 - {``, ``}, // #244 + {``, ``}, // #244 + {``, ``}, // #244 {`
`, `
`}, // #291 // go fuzz