Skip to content

Commit

Permalink
Merge pull request #191 from JosephUz/master
Browse files Browse the repository at this point in the history
solves #160
  • Loading branch information
sahat committed Feb 16, 2019
2 parents a78b2f0 + d00d3fe commit ba0f0d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/express-handlebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,15 +239,15 @@ ExpressHandlebars.prototype.renderView = function (viewPath, options, callback)
// -- Protected Hooks ----------------------------------------------------------

ExpressHandlebars.prototype._compileTemplate = function (template, options) {
return this.handlebars.compile(template, options);
return this.handlebars.compile(template.trim(), options);
};

ExpressHandlebars.prototype._precompileTemplate = function (template, options) {
return this.handlebars.precompile(template, options);
};

ExpressHandlebars.prototype._renderTemplate = function (template, context, options) {
return template(context, options);
return template(context, options).trim();
};

// -- Private ------------------------------------------------------------------
Expand Down

0 comments on commit ba0f0d7

Please sign in to comment.