Skip to content
This repository was archived by the owner on Sep 14, 2021. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pandoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,12 @@ exports.convert = function(type, input, types, callback) {
//so that we have the target type in scope on('data') - love ya some asynch
pandoc.stdout.targetType = types[i];

// Data may be batched. Ensure an empty placeholder is available for incremental collection.
res[types[i]] = '';

pandoc.stdout.on('data', function(data) {
//data will be a binary stream if you don't cast it to a string
res[this.targetType] = data + '';
res[this.targetType] += data + '';
});

pandoc.on('error', function(err) {
Expand Down