From 9c8cc41de58882e27e9c36f6fff357922342e363 Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 28 Jun 2018 12:11:53 -0700 Subject: [PATCH] fix tag value if statement --- mustache.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mustache.js b/mustache.js index 413b6f2..3973b09 100644 --- a/mustache.js +++ b/mustache.js @@ -181,9 +181,10 @@ // Get the tag value. if (type === '=') { - value = scanner.scanUntil(equalsRe); - scanner.scan(equalsRe); - scanner.scanUntil(closingTagRe); + value = scanner.scanUntil(closingTagRe); + if (value.charAt(value.length - 1) !== '=') + throw new Error('Setting in template failure'); + value = value.slice(0, -1).trim(); } else if (type === '{') { value = scanner.scanUntil(closingCurlyRe); scanner.scan(curlyRe);