diff --git a/lib/blocks.js b/lib/blocks.js index 9c735f76..0c6a0295 100644 --- a/lib/blocks.js +++ b/lib/blocks.js @@ -85,9 +85,12 @@ var endsWithBlankLine = function(block) { return true; } var t = block.type; - if (t === 'list' || t === 'item') { + if (!block._lastLineChecked && + (t === 'list' || t === 'item')) { + block._lastLineChecked = true; block = block._lastChild; } else { + block._lastLineChecked = true; break; } } diff --git a/lib/node.js b/lib/node.js index 4e2bd82a..a0f29be0 100644 --- a/lib/node.js +++ b/lib/node.js @@ -76,6 +76,7 @@ var Node = function(nodeType, sourcepos) { this._next = null; this._sourcepos = sourcepos; this._lastLineBlank = false; + this._lastLineChecked = false; this._open = true; this._string_content = null; this._literal = null;