Browse Source

Clarified comments

pull/14/head
Vitaly Puzrin 10 years ago
parent
commit
a48454b99a
  1. 2
      lib/parser_block.js
  2. 7
      lib/rules_block/state_block.js

2
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; }

7
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;

Loading…
Cancel
Save