Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

… a _
  • Loading branch information...
commit 1af361839f7a4088db190e49444b9471ccd600ad 1 parent f7b1733
@pdokas pdokas authored tkellen committed
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() {
Please sign in to comment.
Something went wrong with that request. Please try again.