Browse Source

Fix list continuation.

It should take indent into account:
---
- lev1
  - lev2

- next
---
pull/14/head
Alex Kocharin 10 years ago
parent
commit
4f834e417d
  1. 3
      lib/lexer_block.js
  2. 6
      lib/lexer_block/list.js

3
lib/lexer_block.js

@ -150,10 +150,11 @@ LexerBlock.prototype.tokenize = function (state, startLine, endLine, stopOnTwoNe
if (line < endLine && isEmpty(state, line)) {
hasEmptyLines = true;
state.line = line = line + 1;
line++;
// two empty lines should stop the parser
if (line < endLine && stopOnTwoNewlines && isEmpty(state, line)) { break; }
state.line = line;
}
}
};

6
lib/lexer_block/list.js

@ -133,8 +133,6 @@ module.exports = function list(state, startLine, endLine, silent) {
prevEmptyEnd = false;
while (nextLine < endLine) {
if (state.bqMarks[nextLine] < state.bqLevel) { break; }
contentStart = skipSpaces(state, posAfterMarker);
max = state.eMarks[nextLine];
@ -199,8 +197,10 @@ module.exports = function list(state, startLine, endLine, silent) {
}
//
// Try to ckeck if list is terminated or continued.
// Try to check if list is terminated or continued.
//
if (state.tShift[nextLine] < state.blkIndent) { break; }
if (state.bqMarks[nextLine] < state.bqLevel) { break; }
// fail if terminating block found
if (rules_named.fences(state, nextLine, endLine, true)) { break; }

Loading…
Cancel
Save