summaryrefslogtreecommitdiffstats
path: root/lib/template
diff options
context:
space:
mode:
authorSamy Pesse <samypesse@gmail.com>2016-02-18 19:19:09 +0100
committerSamy Pesse <samypesse@gmail.com>2016-02-18 19:19:09 +0100
commitf763e1dc4201f1593c1baf26697b175e96402442 (patch)
treeba46f4ede0460007825817b1cd800cb927ceadca /lib/template
parentea13e3cec45ad2b52f9346914331c43d91000d17 (diff)
downloadgitbook-f763e1dc4201f1593c1baf26697b175e96402442.zip
gitbook-f763e1dc4201f1593c1baf26697b175e96402442.tar.gz
gitbook-f763e1dc4201f1593c1baf26697b175e96402442.tar.bz2
Lint after travis tests
Diffstat (limited to 'lib/template')
-rw-r--r--lib/template/index.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/template/index.js b/lib/template/index.js
index bb8272c..d426988 100644
--- a/lib/template/index.js
+++ b/lib/template/index.js
@@ -176,7 +176,7 @@ TemplateEngine.prototype.addBlock = function(name, block) {
var args = parser.parseSignature(null, true);
parser.advanceAfterBlockEnd(tok.value);
- while (1) {
+ do {
// Read body
var currentBody = parser.parseUntilBlocks.apply(parser, allBlocks);
@@ -193,14 +193,14 @@ TemplateEngine.prototype.addBlock = function(name, block) {
// Read new block
lastBlockName = parser.peekToken().value;
- if (lastBlockName == block.end) {
- break;
- }
// Parse signature and move to the end of the block
- lastBlockArgs = parser.parseSignature(null, true);
- parser.advanceAfterBlockEnd(lastBlockName);
- }
+ if (lastBlockName != block.end) {
+ lastBlockArgs = parser.parseSignature(null, true);
+ parser.advanceAfterBlockEnd(lastBlockName);
+ }
+ } while (lastBlockName == block.end)
+
parser.advanceAfterBlockEnd();
var bodies = [body];