Browse Source

Workaround for a bug with nested list elements tightness

pull/14/head
Alex Kocharin 10 years ago
parent
commit
d3658c33dc
  1. 9
      lib/lexer_block.js

9
lib/lexer_block.js

@ -145,12 +145,17 @@ LexerBlock.prototype.tokenize = function (state, startLine, endLine) {
throw new Error('None of rules updated state.line'); throw new Error('None of rules updated state.line');
} }
line = state.line;
// set state.tight iff we had an empty line before current tag // set state.tight iff we had an empty line before current tag
// i.e. latest empty line should not count // i.e. latest empty line should not count
state.tight = !hasEmptyLines; 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)) { if (line < endLine && isEmpty(state, line)) {
hasEmptyLines = true; hasEmptyLines = true;
line++; line++;

Loading…
Cancel
Save