From 25a2ec46c0958f06fb93a12e0ca26e8b61acaa2a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 15 Jan 2015 12:35:33 -0800 Subject: Removed vestigial ReferenceDef node type. --- js/lib/blocks.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'js/lib/blocks.js') diff --git a/js/lib/blocks.js b/js/lib/blocks.js index 617d60d..d8c25a1 100644 --- a/js/lib/blocks.js +++ b/js/lib/blocks.js @@ -220,8 +220,9 @@ var listsMatch = function(list_data, item_data) { var closeUnmatchedBlocks = function() { // finalize any blocks not matched while (this.oldtip !== this.lastMatchedContainer) { + var parent = this.oldtip.parent; this.finalize(this.oldtip, this.lineNumber - 1); - this.oldtip = this.oldtip.parent; + this.oldtip = parent; } return true; }; @@ -561,6 +562,7 @@ var incorporateLine = function(ln) { // parent of the closed block. var finalize = function(block, lineNumber) { var pos; + var above = block.parent || this.top; // don't do anything if the block is already closed if (!block.open) { return 0; @@ -578,7 +580,7 @@ var finalize = function(block, lineNumber) { this.refmap))) { block.string_content = block.string_content.slice(pos); if (isBlank(block.string_content)) { - block.setType('ReferenceDef'); + block.unlink(); break; } } @@ -635,7 +637,7 @@ var finalize = function(block, lineNumber) { break; } - this.tip = block.parent || this.top; + this.tip = above; }; // Walk through a block & children recursively, parsing string content -- cgit v1.2.3