ansi-viewer fixes.

This commit is contained in:
Christopher Jeffrey 2015-04-20 15:04:39 -07:00
parent 8b886e7539
commit 8194294ac7
1 changed files with 11 additions and 1 deletions

View File

@ -161,8 +161,18 @@ list.on('select', function(url, selected) {
return msg.error(err.message); return msg.error(err.message);
} }
if (process.argv[2] === '--debug') {
fs.writeFileSync(__dirname + '/../../output.ans', body);
}
// Remove text:
body = body.replace('Downloaded From P-80 International Information Systems 304-744-2253', '');
// Remove MCI codes: // Remove MCI codes:
//body = body.replace(/%[A-Z0-9]{2}/g, ''); body = body.replace(/%[A-Z0-9]{2}/g, '');
// ^A (SOH) seems to need to produce CRLF in some cases:
body = body.replace(/\x01/g, '\r\n');
// Reset and write the art: // Reset and write the art:
art.term.reset(); art.term.reset();