Skip to content

Commit

Permalink
Fix #33, bump version to 0.2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
FWeinb committed Jun 20, 2014
1 parent 20ade41 commit 2884107
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ In lieu of a formal styleguide, take care to maintain the existing coding style.

## Release History

#### 0.2.5
* To generate the id from the filename is now used as a title. (Fix [#33](https://github.com/FWeinb/grunt-svgstore/issues/33))

#### 0.2.4
* Added `options.symbol` to add attributes to generated `<symbol>`s ([#30](https://github.com/FWeinb/grunt-svgstore/pull/30))
* To generate the id from the filename the name is now cut right before the first dot. `name.min.svg` becomes `name`. (Fixes [#29](https://github.com/FWeinb/grunt-svgstore/issues/29))
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "grunt-svgstore",
"description": "Merge SVGs from a folder.",
"version": "0.2.4",
"version": "0.2.5",
"homepage": "https://github.com/FWeinb/grunt-svgstore",
"author": {
"name": "Fabrice Weinberg",
Expand Down
6 changes: 4 additions & 2 deletions tasks/svgstore.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,10 @@ module.exports = function (grunt) {
$title.remove();
$desc.remove();

var id = convertNameToId(filename);

// If there is no title use the filename
title = title || filename;
title = title || id;

var resultStr = '<symbol' + symbolAttrs + '>' + '<title>' + title + '</title>';

Expand All @@ -150,7 +152,7 @@ module.exports = function (grunt) {

$res('symbol').attr('viewBox', $svg.attr('viewBox'));

var graphicId = options.prefix + convertNameToId(filename);
var graphicId = options.prefix + id;
// Add ID to the first Element
$res('*').first().attr('id', graphicId);

Expand Down
2 changes: 1 addition & 1 deletion test/expected/cutnameafterfirstdot.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion test/fixtures/naming/name.min.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 2884107

Please sign in to comment.