Skip to content

Commit

Permalink
Remove final newline in empty document
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Jun 22, 2015
1 parent 92636d4 commit 2256a7a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/compilers.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,17 @@ function all(parent) {
*/
function root(node) {
var self = this;
var result;

self.definitions = [];
self.footnotes = [];

visit(node, 'definition', addDefinition, self);
visit(node, 'footnoteDefinition', addFootnoteDefinition, self);

return self.all(node).join('\n') + '\n' + self.generateFootnotes();
result = self.all(node).join('\n');

return (result ? result + '\n' : '') + self.generateFootnotes();
}

/**
Expand Down

0 comments on commit 2256a7a

Please sign in to comment.