Skip to content

Commit

Permalink
Add _linkRefs flag.
Browse files Browse the repository at this point in the history
  • Loading branch information
tmpfs committed Mar 21, 2016
1 parent 4471bd7 commit ffc342d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion collator.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,16 @@ function flush(cb) {
var doc = Node.createDocument()
, para = Node.createNode(Node.PARAGRAPH);

doc._linkRefs = true;

this.refs.forEach(function(ref) {
para.appendChild(attach(ref));
})

// NOTE: do not append paragraph, push to the stream
this.push(doc);
this.push(para);
this.push(Node.createNode(Node.EOF));
this.push(Node.createNode(Node.EOF, {_linkRefs: true}));
}
cb();
}
Expand Down
4 changes: 2 additions & 2 deletions test/spec/links-callback.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ describe('mkref:', function() {
function onFinish() {
var result = utils.result(target);

//console.dir(result);

// open document
expect(result[0]._type).to.eql(Node.DOCUMENT);

// mock document paragraph
expect(result[1]._type).to.eql(Node.PARAGRAPH);

// eof main document
expect(result[2]._type).to.eql(Node.EOF);

Expand Down

0 comments on commit ffc342d

Please sign in to comment.