aboutsummaryrefslogtreecommitdiff
path: root/js/lib/blocks.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/lib/blocks.js')
-rw-r--r--js/lib/blocks.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/js/lib/blocks.js b/js/lib/blocks.js
index abaea17..23b0283 100644
--- a/js/lib/blocks.js
+++ b/js/lib/blocks.js
@@ -506,16 +506,17 @@ var incorporateLine = function(ln) {
// and we don't count blanks in fenced code for purposes of tight/loose
// lists or breaking out of lists. We also don't set _lastLineBlank
// on an empty list item, or if we just closed a fenced block.
- container._lastLineBlank = blank &&
+ var lastLineBlank = blank &&
!(t === 'BlockQuote' ||
(t === 'CodeBlock' && container._isFenced) ||
(t === 'Item' &&
!container._firstChild &&
container.sourcepos[0][0] === this.lineNumber));
+ // propagate lastLineBlank up through parents:
var cont = container;
- while (cont._parent) {
- cont._parent._lastLineBlank = false;
+ while (cont) {
+ cont._lastLineBlank = lastLineBlank;
cont = cont._parent;
}