From e3e6ce1c814685eca7d998198f0aef749233e06d Mon Sep 17 00:00:00 2001 From: E-K-n Date: Mon, 22 Jul 2019 15:24:54 +0200 Subject: [PATCH] Expand context in renderPartial's call to renderTokens. Fix for "Partials in nested objects don't work #627" --- mustache.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mustache.js b/mustache.js index 8ec1b44..7c1493c 100644 --- a/mustache.js +++ b/mustache.js @@ -597,7 +597,8 @@ var value = isFunction(partials) ? partials(token[1]) : partials[token[1]]; if (value != null) - return this.renderTokens(this.parse(value, tags), context, partials, value); + return this.renderTokens(this.parse(value, tags), context.view[token[1]] ? + context.push(context.view[token[1]]) : context, partials, value); }; Writer.prototype.unescapedValue = function unescapedValue (token, context) {