Skip to content

Commit

Permalink
Merge pull request #24 from keithamus/patch-1
Browse files Browse the repository at this point in the history
Ensure _loaderHelpers registers actual filenames
  • Loading branch information
Eran Hammer committed Jun 21, 2015
2 parents 658220b + 429116e commit 3e085c4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/manager.js
Expand Up @@ -251,7 +251,7 @@ internals.Manager.prototype._loadHelpers = function (engine) {
var helper = require(file);
if (typeof helper === 'function') {
var offset = path.slice(-1) === Path.sep ? 0 : 1;
var name = file.slice(path.length + offset, -3);
var name = file.slice(path.length + offset, -Path.extname(file).length);
engine.module.registerHelper(name, helper);
}
}
Expand Down
4 changes: 4 additions & 0 deletions test/templates/valid/helpers/long.javascript
@@ -0,0 +1,4 @@
exports = module.exports = function (context) {

return context;
};
2 changes: 1 addition & 1 deletion test/templates/valid/testHelpers.html
@@ -1 +1 @@
<p>This is all {{uppercase this.something}} and this is how we like it!</p>
<p>This is all {{uppercase this.something}} and this is {{long "how"}} we like it!</p>

0 comments on commit 3e085c4

Please sign in to comment.