diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-01-15 12:35:33 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-01-15 12:35:33 -0800 |
commit | 25a2ec46c0958f06fb93a12e0ca26e8b61acaa2a (patch) | |
tree | c27eae0d915b5a49456de238eb6dca471a1c37fd | |
parent | 8f2f40679dc21e9d878aaed45fe9dc9d404073d0 (diff) |
Removed vestigial ReferenceDef node type.
-rw-r--r-- | js/lib/blocks.js | 8 | ||||
-rw-r--r-- | js/lib/html.js | 4 | ||||
-rw-r--r-- | js/lib/xml.js | 4 |
3 files changed, 5 insertions, 11 deletions
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 diff --git a/js/lib/html.js b/js/lib/html.js index 8e096dd..fd0aaf1 100644 --- a/js/lib/html.js +++ b/js/lib/html.js @@ -220,10 +220,6 @@ var renderNodes = function(block) { cr(); break; - - case 'ReferenceDef': - break; - default: throw "Unknown node type " + node.getType(); } diff --git a/js/lib/xml.js b/js/lib/xml.js index 4932e31..8e4b689 100644 --- a/js/lib/xml.js +++ b/js/lib/xml.js @@ -74,10 +74,6 @@ var renderNodes = function(block) { node = event.node; nodetype = node.getType(); - if (nodetype === 'ReferenceDef') { - continue; - } - container = node.isContainer(); selfClosing = nodetype === 'HorizontalRule' || nodetype === 'Hardbreak' || nodetype === 'Softbreak' || nodetype === 'Image'; |