From b3dd9649bed713ca0d9b25bf03332422606cc682 Mon Sep 17 00:00:00 2001 From: Phillip Johnsen Date: Mon, 26 Aug 2019 21:17:31 +0200 Subject: [PATCH] Bugfix for wrong functions output in partials with indentation This small change fixes the output of functions used in partials with indentation. Bug reports has shown that the functions output is shifted with the amount of indentation the partial has. The bug itself is best illustrated in the tests added in 621ae80652b0ef363f5c8f2aab4c5e885b0d953e. Closes https://github.com/janl/mustache.js/issues/712 --- mustache.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mustache.js b/mustache.js index aee287648..a1a576fca 100644 --- a/mustache.js +++ b/mustache.js @@ -632,7 +632,7 @@ if (tagIndex == 0 && indentation) { indentedValue = this.indentPartial(value, indentation); } - return this.renderTokens(this.parse(indentedValue, tags), context, partials, value); + return this.renderTokens(this.parse(indentedValue, tags), context, partials, indentedValue); } };