diff options
author | John MacFarlane <[email protected]> | 2015-01-10 17:27:26 -0800 |
---|---|---|
committer | John MacFarlane <[email protected]> | 2015-01-10 17:27:26 -0800 |
commit | 145424ab245350a4a6eec1adab8d57402677530e (patch) | |
tree | e7e71aad949ef8890b051e9f894de0602061b331 /js/test.js | |
parent | 2fe4743a1303ca5dcba4018519a044e9de8e11db (diff) |
Removed ansi from js source tree.
Test suite will now use ansi if the package is installed,
otherwise skip it.
Diffstat (limited to 'js/test.js')
-rwxr-xr-x | js/test.js | 22 |
1 files changed, 20 insertions, 2 deletions
@@ -3,8 +3,26 @@ var fs = require('fs'); var commonmark = require('./lib/index.js'); -var ansi = require('./ansi/ansi'); -var cursor = ansi(process.stdout); +var ansi; +var cursor; + +try { + ansi = require('ansi'); + cursor = ansi(process.stdout); +} +catch(err) { + var noOp = function() { return this; }; + cursor = { + write: function (s) { + process.stdout.write(s); + return this; + }, + green: noOp, + red: noOp, + cyan: noOp, + reset: noOp, + }; +} var writer = new commonmark.HtmlRenderer(); var reader = new commonmark.DocParser(); |