Browse Source

Fix paragraph tightness

`state.tight` might be updated in the rules, so we should set it
after running rules, not before
pull/14/head
Alex Kocharin 10 years ago
parent
commit
178cdf4777
  1. 6
      lib/lexer_block.js

6
lib/lexer_block.js

@ -127,8 +127,6 @@ LexerBlock.prototype.tokenize = function (state, startLine, endLine) {
if (state.tShift[line] < state.blkIndent) { break; }
if (state.bqMarks[line] < state.bqLevel) { break; }
state.tight = !hasEmptyLines;
// Try all possible rules.
// On success, rule should:
//
@ -149,6 +147,10 @@ LexerBlock.prototype.tokenize = function (state, startLine, endLine) {
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;
if (line < endLine && isEmpty(state, line)) {
hasEmptyLines = true;
line++;

Loading…
Cancel
Save