mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-17 03:01:08 +01:00
fixes #123, parse object properties in template outside of namespace
This commit is contained in:
@@ -300,14 +300,7 @@
|
||||
namespace = namespace.replace(d + '.', '');
|
||||
template = setBlock(regex, result, template);
|
||||
} else if (data[d] instanceof Object) {
|
||||
namespace += d + '.';
|
||||
|
||||
regex = makeRegex(d),
|
||||
block = getBlock(regex, namespace, template)
|
||||
if (block == null) continue;
|
||||
|
||||
block = parse(data[d], namespace, block);
|
||||
template = setBlock(regex, block, template);
|
||||
template = parse(data[d], d + '.', template);
|
||||
} else {
|
||||
function checkConditional(key, value) {
|
||||
var conditional = makeConditionalRegex(key),
|
||||
@@ -352,6 +345,7 @@
|
||||
if (namespace) {
|
||||
var regex = new RegExp("{" + namespace + "[\\s\\S]*?}", 'g');
|
||||
template = template.replace(regex, '');
|
||||
namespace = '';
|
||||
}
|
||||
|
||||
// clean up all undefined conditionals
|
||||
|
||||
Reference in New Issue
Block a user