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

v1.18.x
psychobunny 12 years ago
parent a655ebb290
commit ab456e07af

@ -62,6 +62,10 @@ var templates = {};
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)) {

@ -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)) {

Loading…
Cancel
Save