Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting xmlDeclaration and doctypeDeclaration to false generates a "falsefalse" preamble #89

Closed
jraoult opened this issue Jun 8, 2015 · 4 comments
Assignees
Labels

Comments

@jraoult
Copy link

jraoult commented Jun 8, 2015

Reproduced in version 1.2.2

I configure svg-sprite like that:

{
      svg: {
        xmlDeclaration:  false
        doctypeDeclaration: false
      },
      transform: [{
        svgo: {
          plugins: [{
            removeUnknownsAndDefaults: false
          }]
        }
      }],
      mode: {
        symbol: {
          dest: '.',
          sprite: 'sprite.svg'
        }
      }
    }

I get an output file that starts with falsefalse<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><symbol.... Seems like the boolean value is treated as a string instead of disabling the declarations.

@jraoult
Copy link
Author

jraoult commented Jun 8, 2015

Note: a workaround is to set the value of both properties to a blank space (empty string won't work)

@jkphl
Copy link
Collaborator

jkphl commented Jun 8, 2015

Hi @jraoult,

thanks for reporting this. Interesting. I'll look into this — it definitely worked at some point. Could you please tell me a little more about your platform (OS, Node version etc.). Thanks!

Cheers,
Joschi

@jkphl jkphl added the bug label Jun 8, 2015
@jkphl jkphl self-assigned this Jun 8, 2015
@jraoult
Copy link
Author

jraoult commented Jun 8, 2015

@jkphl yes sure. I'm on a mac os (Yosemite). I reproduced on Node 0.12.2 and iojs 2.2.1. Last time I had it working was the 1.1.0 of svg-sprite.

My guess is that this bug was introduced when the rootAttributes setting was added.

jkphl added a commit that referenced this issue Jun 8, 2015
@jkphl
Copy link
Collaborator

jkphl commented Jun 8, 2015

Should be fixed as of release v1.2.3.

@jkphl jkphl closed this as completed Jun 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants