fixes to template parser: hide block if no data exists (prevents the default tpl skeleton from showing up)

This commit is contained in:
psychobunny
2013-05-01 17:01:05 +00:00
parent a655ebb290
commit ab456e07af
2 changed files with 8 additions and 0 deletions

View File

@@ -60,6 +60,10 @@ var fs = require('fs');
var template = this.html, regex, block;
return (function parse(data, namespace, template) {
if (data.length == 0) {
regex = makeRegex('[^]*');
template = template.replace(regex, '');
}
for (var d in data) {
if (data.hasOwnProperty(d)) {