From d3658c33dcf0e2f18e3bc8d3831796b55fd821c4 Mon Sep 17 00:00:00 2001 From: Alex Kocharin Date: Tue, 30 Sep 2014 17:03:09 +0400 Subject: [PATCH] Workaround for a bug with nested list elements tightness --- lib/lexer_block.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/lexer_block.js b/lib/lexer_block.js index d32bd64..81d7abe 100644 --- a/lib/lexer_block.js +++ b/lib/lexer_block.js @@ -145,12 +145,17 @@ LexerBlock.prototype.tokenize = function (state, startLine, endLine) { throw new Error('None of rules updated state.line'); } - line = state.line; - // set state.tight iff we had an empty line before current tag // i.e. latest empty line should not count state.tight = !hasEmptyLines; + // paragraph might "eat" one newline after it in nested lists + if (isEmpty(state, state.line - 1)) { + hasEmptyLines = true; + } + + line = state.line; + if (line < endLine && isEmpty(state, line)) { hasEmptyLines = true; line++;