diff --git a/lib/lexer_block.js b/lib/lexer_block.js index 8a62f94..703751c 100644 --- a/lib/lexer_block.js +++ b/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; } } }; diff --git a/lib/lexer_block/list.js b/lib/lexer_block/list.js index 234f4f2..4e961e3 100644 --- a/lib/lexer_block/list.js +++ b/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; }