Skip to content

Commit

Permalink
Fixed broken keyframe animation support (svg-sprite/gulp-svg-sprite#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkphl committed Aug 28, 2016
1 parent 542c643 commit 5f3edc2
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 1.3.6 Maintenance release (unreleased)
* Updated dependencies
* Fixed LESS template mixin call ([#187](https://github.com/jkphl/svg-sprite/pull/187))
* Fixed broken keyframe animation support ([gulp-svg-sprite #63](https://github.com/jkphl/gulp-svg-sprite/issues/63))

## 1.3.5 Bugfix release (2016-08-15)
* Fixed file name regression bug ([#186](https://github.com/jkphl/svg-sprite/issues/186))
Expand Down
8 changes: 7 additions & 1 deletion lib/svg-sprite/shape.js
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,13 @@ SVGShape.prototype._replaceIdAndClassnameReferencesInCssSelectors = function(str

// @-rule
if (_.isUndefined(selText)) {
if (_.isArray(rule.cssRules)) {

// If there's a key text: Copy the CSS rule
if (rule.keyText) {
css += str.substr(rule.__starts, rule.__ends);

// Else: Recursively process rule content
} else if (_.isArray(rule.cssRules)) {
css += str.substring(rule.__starts, rule.cssRules[0].__starts) + this._replaceIdAndClassnameReferencesInCssSelectors(str, rule.cssRules, substIds, substClassnames) + str.substring(rule.cssRules[rule.cssRules.length - 1].__ends, rule.__ends);
}

Expand Down
28 changes: 28 additions & 0 deletions test/fixture/svg/animation/keyframes.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5f3edc2

Please sign in to comment.