Closed fulminant closed 7 years ago
<symbol id="calendar" viewBox="0 0 14 12">
[
o
b
j
e
c
t
O
b
j
e
c
t
]
[
o
b
j
e
c
t
O
b
j
e
c
t
]
</symbol>
The same is happening with me on Mac
The same problem!!!!
+1 same problem here on MacOS
windows 10 x64 The same problem!!!! I solved this problem by changing the pattern "symbols.svg" `
<% }); %>
`
windows 10 x64 The same problem
@soenkekluth any solution to this problem?
Bug happens upstream: https://github.com/shakyShane/svg-sprite-data/issues/6
Though in gulp-svg-sprite, the default template would have to be fixed (there’s no need to iterate on a string).
Have you found solution?
@xahon If you just need symbols I wrote https://github.com/mllrsohn/gulp-svg-symbol-sprite today which generates something like this:
<svg height="0" style="position: absolute" width="0" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<symbol id="arrow" viewbox="0 0 25 45">
<path d="..."/>
</symbol>
<symbol id="cart" viewbox="0 0 21.5 17">
<path d="..."/>
<circle cx="4.793" cy="15.206" r="1.794"/>
<circle cx="13.208" cy="15.206" r="1.794"/>
</symbol>
</svg>
It works for my projects - so no tests so far. The code is relative simple. Have a look if it fits your needs.
Until it's fixed you can save the changed symbols template in your project and override the path:
.pipe(plugins.svgSprites({
mode: 'symbols',
preview: {
sprite: 'index.html'
},
templates: {
symbols: require('fs').readFileSync('./dev/symbols.svg')
}
}))```
This happens when i use symbols mode:
This is my task:
and i tried so