ajstarks / svgo

Go Language Library for SVG generation
Other
2.14k stars 169 forks source link

Remove dependence on ordering of attributes #43

Closed GamingCoder closed 6 years ago

GamingCoder commented 6 years ago

When you supply the styling string as an attribute before other attributes the generated SVG will be invalid since a space between the end of the styling string and the name of the following attribute was missing.

The Go code canvas.Text(100, 100, "Lorem ipsum", "fill: #ff0000;", "text-anchor=\"start\"") would generate <text x="100" y="100" style="fill: #ff0000;"text-anchor="start" >Lorem ipsum</text>, which should be <text x="100" y="100" style="fill: #ff0000;" text-anchor="start" >Lorem ipsum</text> with a space between style="fill: #ff0000;"and text-anchor="start".

ajstarks commented 6 years ago

fixed with commit b7e3ba6