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

Prefix ids plugin don't add prefix if prefix is false #907

Merged

Conversation

vzaidman
Copy link
Contributor

@vzaidman vzaidman commented Feb 18, 2018

i use it like this:

plugins: [
          {convertPathData: false},
          {prefixIds: {
            prefix: node => {
              const elementName = node && node.elem
              if(!elementName || elementName === 'svg' || elementName === 'use'){
                return false
              }

              return 'some-prefix'
            }
          }}
        ]

and i expect no prefix when i return prefix as false.

it can also be used as

plugins: [
          {convertPathData: false},
          {prefixIds: {prefix: false}}
        ]

@strarsis
Copy link
Contributor

strarsis commented Mar 2, 2018

@vzaidman: This is very similar to this issue (please also check out the code sample in that issue):
#913 (comment)

@vzaidman vzaidman force-pushed the prefixIds-plugin-don't-add-prefix-if-prefix-is-false branch from 0d142a4 to 0bbcfac Compare March 15, 2018 15:21
@vzaidman
Copy link
Contributor Author

vzaidman commented Mar 15, 2018

rebased my fix on master.
what do you think, people?

@GreLI GreLI merged commit 0a142f3 into svg:master Mar 16, 2018
@vzaidman
Copy link
Contributor Author

Why don't i see it in thew latest version?
can you please publish it?

@vzaidman vzaidman deleted the prefixIds-plugin-don't-add-prefix-if-prefix-is-false branch April 24, 2018 11:57
@GreLI
Copy link
Member

GreLI commented Sep 16, 2018

SVGO v1.1.0 with the fix has been just released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants