Browse files

Only automatically strip the leading character from a partial if it's…

… a _
  • Loading branch information...
1 parent f7b1733 commit 1af361839f7a4088db190e49444b9471ccd600ad @pdokas pdokas committed with tkellen Feb 21, 2013
Showing with 4 additions and 1 deletion.
  1. +4 −1 tasks/handlebars.js
View
5 tasks/handlebars.js
@@ -22,7 +22,10 @@ module.exports = function(grunt) {
var defaultProcessPartialName = function(filePath) {
var pieces = _.last(filePath.split('/')).split('.');
var name = _(pieces).without(_.last(pieces)).join('.'); // strips file extension
- return name.substr(1, name.length); // strips leading _ character
+ if (name.charAt(0) === '_') {
+ name = name.substr(1, name.length); // strips leading _ character
+ }
+ return name;
};
grunt.registerMultiTask('handlebars', 'Compile handlebars templates and partials.', function() {

0 comments on commit 1af3618

Please sign in to comment.