minor async refactor.

This commit is contained in:
Christopher Jeffrey 2013-06-05 03:59:15 -05:00
parent b16061ba2f
commit f1851a18c8

View File

@ -1044,13 +1044,9 @@ function marked(src, opt, callback) {
pending = tokens.length;
var done = function(hi) {
var done = function() {
var out, err;
if (hi !== true) {
delete opt.highlight;
}
try {
out = Parser.parse(tokens, opt);
} catch (e) {
@ -1065,9 +1061,11 @@ function marked(src, opt, callback) {
};
if (!highlight || highlight.length < 3) {
return done(true);
return done();
}
delete opt.highlight;
if (!pending) return done();
for (; i < tokens.length; i++) {