mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-21 02:29:23 +00:00
22 lines
490 B
JavaScript
22 lines
490 B
JavaScript
(function(){
|
|
'use strict';
|
|
|
|
var main = global.cloudcmd.main,
|
|
marked = main.require('marked'),
|
|
Util = main.util;
|
|
|
|
exports.parse = parse;
|
|
|
|
function parse(data, callback) {
|
|
var md;
|
|
|
|
process.nextTick(function() {
|
|
if (marked)
|
|
md = marked(data);
|
|
else
|
|
md = '<pre>' + data + '</pre>';
|
|
|
|
Util.exec(callback, md);
|
|
});
|
|
}
|
|
})();
|