mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 14:35:47 +01:00
fixes to template parser: hide block if no data exists (prevents the default tpl skeleton from showing up)
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user