diff --git a/js/module.js b/js/module.js index 43a1603a..464509ee 100644 --- a/js/module.js +++ b/js/module.js @@ -86,7 +86,7 @@ var Module = Class.extend({ var templateData = this.getTemplateData(); // Check to see if we need to render a template string or a file. - if (/^.*(\.html)$/.test(template)) { + if (/^.*((\.html)|(\.njk))$/.test(template)) { // the template is a filename this.nunjucksEnvironment().render(template, templateData, function (err, res) { if (err) { @@ -170,7 +170,10 @@ var Module = Class.extend({ var self = this; - this._nunjucksEnvironment = new nunjucks.Environment(new nunjucks.WebLoader(this.file(""), {async: true})); + this._nunjucksEnvironment = new nunjucks.Environment(new nunjucks.WebLoader(this.file(""), {async: true}), { + trimBlocks: true, + lstripBlocks: true + }); this._nunjucksEnvironment.addFilter("translate", function(str) { return self.translate(str) }); diff --git a/modules/default/helloworld/helloworld.js b/modules/default/helloworld/helloworld.js index 4de10acd..a1fb9d7d 100644 --- a/modules/default/helloworld/helloworld.js +++ b/modules/default/helloworld/helloworld.js @@ -15,7 +15,7 @@ Module.register("helloworld",{ }, getTemplate: function () { - return "helloworld.html" + return "helloworld.njk" }, getTemplateData: function () { diff --git a/modules/default/helloworld/helloworld.html b/modules/default/helloworld/helloworld.njk similarity index 100% rename from modules/default/helloworld/helloworld.html rename to modules/default/helloworld/helloworld.njk