From a48454b99a07ce62c363727a869ebfcb6b06728e Mon Sep 17 00:00:00 2001 From: Vitaly Puzrin Date: Thu, 16 Oct 2014 07:38:07 +0400 Subject: [PATCH] Clarified comments --- lib/parser_block.js | 2 ++ lib/rules_block/state_block.js | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/parser_block.js b/lib/parser_block.js index f18e165..af59978 100644 --- a/lib/parser_block.js +++ b/lib/parser_block.js @@ -60,6 +60,8 @@ ParserBlock.prototype.tokenize = function (state, startLine, endLine) { state.line = line = state.skipEmptyLines(line); if (line >= endLine) { break; } + // Termination condition for nested calls. + // Nested calls currently used for blockquotes & lists if (state.tShift[line] < state.blkIndent) { break; } if (state.bqMarks[line] < state.bqLevel) { break; } diff --git a/lib/rules_block/state_block.js b/lib/rules_block/state_block.js index 288a996..a1507e4 100644 --- a/lib/rules_block/state_block.js +++ b/lib/rules_block/state_block.js @@ -29,15 +29,16 @@ function State(src, parser, tokens, options, env) { this.bMarks = []; // line begin offsets for fast jumps this.eMarks = []; // line end offsets for fast jumps this.tShift = []; // indent for each line - this.bqMarks = []; // lines shifts in blockquotes (calculated on bq enter) + this.bqMarks = []; // blockquote nesting level for each line (number of '>') // block parser variables - this.blkIndent = 0; + this.blkIndent = 0; // required block content indent + // (for example, if we are in list) this.line = 0; // line index in src this.lineMax = 0; // lines count this.tight = false; // loose/tight mode for lists this.listMode = false; // if true, block parser stops on two newlines - this.bqLevel = 0; // blockquote nesting level + this.bqLevel = 0; // blockquote nesting level for currently tokenized block this.level = 0;