nfroidure / gulp-iconfont

Create icon fonts from several SVG icons
MIT License
854 stars 72 forks source link

svg file can't be complied correctly #198

Closed uyarn closed 2 years ago

uyarn commented 3 years ago

Hi, we use gulp-iconfont to generate a svg file from many single svg icon file. According to the guidance, the configuration is like the code below

src([iconGlob])
      .pipe(iconfontCss(fontCssConfig))
      .pipe(
        iconfont({
          fontName: 't', // required
          prependUnicode: true, // recommended option
          formats: ['ttf', 'eot', 'woff', 'svg'], // default, 'woff2' and 'svg' are available
          timestamp: runTimestamp, // recommended to get consistent builds when watching files
        }),
  )

Although the workflow has generated the svg file successfully, it can't be used and we got the error below when we opened it on browser. image and when we removed the xmlns attribute from the svg tag like this, it worked without any error. <svg xmlns="http://www.w3.org/2000/svg">...</svg> ——> <svg></svg> Anybody know how to resolve it with any configuration? oh this is a bug?