Skip to content

Commit

Permalink
Fixed missing file extensions with CSS resources (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkphl committed Feb 10, 2015
1 parent 2683e81 commit 7bda06d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## master (will become 1.0.15)
* Fixed missing file extensions with CSS resources ([#54](https://github.com/jkphl/svg-sprite/issues/54))

## 1.0.14 Maintenance release (2015-02-08)
* Restructured documentation
* Updated dependencies
Expand Down
6 changes: 6 additions & 0 deletions lib/svg-sprite/mode/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ function SVGSpriteBase(spriter, config, data, key) {
}
if ('dest' in this.config.render[extension]) {
renderConfig.dest = path.resolve(this.config.dest, this.config.render[extension].dest);
if (!renderConfig.dest.match(new RegExp('\\.' + extension + '$', 'i'))) {
renderConfig.dest += '.' + extension;
}
}
} else if (this.config.render[extension] !== true) {
delete this.config.render[extension];
Expand Down Expand Up @@ -123,6 +126,9 @@ SVGSpriteBase.prototype._initData = function(data) {
}
if ('dest' in this.config.example) {
renderConfig.dest = path.resolve(this.config.dest, this.config.example.dest);
if (!renderConfig.dest.match(new RegExp('\\.html?$', 'i'))) {
renderConfig.dest += '.html';
}
}
} else if (this.config.example !== true) {
renderConfig = false;
Expand Down

0 comments on commit 7bda06d

Please sign in to comment.