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

Escape hash sing built-in function #294

Merged
merged 1 commit into from
Jan 18, 2020
Merged

Conversation

popinguy
Copy link

@popinguy popinguy commented Sep 1, 2019

Creates an ability to generate scss file, which contains css classes such as
.{{name}}-background {
background: url('data:image/svg+xml;utf-8,{{#escapeHashSign}}{{{svg}}}{{/escapeHashSign}}') no-repeat;
}

Some svg-files contain hash signs ('#') which make it impossible to use such svg's as data urls. Url encoding of the whole file should work but It's not always suitable to increase generated file size. So I found it appropriate to encode only hash signs symbols. Using the library in cli mode makes it impossible to pass custom variables function to generator so it's the simplest way to deal with it.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 78.732% when pulling c7f5d97 on popinguy:master into 6966592 on jkphl:master.

@jkphl jkphl merged commit c7f5d97 into svg-sprite:master Jan 18, 2020
MartijnCuppens pushed a commit to MartijnCuppens/svg-sprite that referenced this pull request Jan 18, 2020
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