Codebase list golang-github-tdewolff-minify / 91d7688
SVG: keep width/height attributes for <svg>, fixes #367 Taco de Wolff 3 years ago
2 changed file(s) with 2 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
141141 tag == Svg && (attr == Version && bytes.Equal(val, []byte("1.1")) ||
142142 attr == X && bytes.Equal(val, zeroBytes) ||
143143 attr == Y && bytes.Equal(val, zeroBytes) ||
144 attr == Width && bytes.Equal(val, n100pBytes) ||
145 attr == Height && bytes.Equal(val, n100pBytes) ||
146144 attr == PreserveAspectRatio && bytes.Equal(val, []byte("xMidYMid meet")) ||
147145 attr == BaseProfile && bytes.Equal(val, noneBytes) ||
148146 attr == ContentScriptType && bytes.Equal(val, []byte("application/ecmascript")) ||
2626 {`<style> <![CDATA[ <<<<< ]]> </style>`, `<style><![CDATA[ <<<<< ]]></style>`},
2727 {`<style/><![CDATA[ <<<<< ]]>`, `<style/><![CDATA[ <<<<< ]]>`},
2828 {`<svg version="1.0"></svg>`, `<svg version="1.0"/>`},
29 {`<svg version="1.1" x="0" y="0px" width="100%" height="100%"><path/></svg>`, `<svg><path/></svg>`},
29 {`<svg version="1.1" x="0" y="0px" width="100%" height="100%"><path/></svg>`, `<svg width="100%" height="100%"><path/></svg>`},
30 {`<svg width="auto" height="auto"><path/></svg>`, `<svg width="auto" height="auto"><path/></svg>`},
3031 // TODO: what abour x="" y="" for viewBox?
3132 //{`<svg width="24" height="24" viewBox="0 0 24 24"></svg>`, `<svg width="24" height="24"/>`},
3233 {`<path x="a"> </path>`, `<path x="a"/>`},