From 395a24df424caeab18e989499f1579762d1cc7e0 Mon Sep 17 00:00:00 2001 From: Yotam Madem Date: Thu, 27 Jun 2019 19:53:26 +0300 Subject: [PATCH] fix code styling issues --- mustache.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/mustache.js b/mustache.js index 8e400fd..aeb25a2 100644 --- a/mustache.js +++ b/mustache.js @@ -132,7 +132,7 @@ function stripSpace () { if (hasTag && !nonSpace) { while (spaces.length) - delete tokens[spaces.pop()]; + delete tokens[spaces.pop()]; } else { spaces = []; } @@ -182,7 +182,7 @@ start += 1; // Check for whitespace on the current line. - if (chr === '\n'){ + if (chr === '\n') { stripSpace(); indentation = ''; tagIndex = 0; @@ -193,12 +193,11 @@ // Match the opening tag. if (!scanner.scan(openingTagRe)) break; - + hasTag = true; // Get the tag type. type = scanner.scan(tagRe) || 'name'; - scanner.scan(whiteRe); // Get the tag value. @@ -224,9 +223,7 @@ if (type == '>' && tagIndex == 0) { token.push(indentation); } - tagIndex ++; - tokens.push(token); if (type === '#' || type === '^') { @@ -256,7 +253,7 @@ if (openSection) throw new Error('Unclosed section "' + openSection[1] + '" at ' + scanner.pos); - return nestTokens(squashTokens(tokens)); + return nestTokens(squashTokens(tokens)); } /** @@ -560,10 +557,10 @@ else if (symbol === 'name') value = this.escapedValue(token, context); else if (symbol === 'text') value = this.rawValue(token); - if (value !== undefined) { + if (value !== undefined) buffer += value; - } } + return buffer; };