Skip to content

Commit

Permalink
🗜️ build [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkedJS bot committed May 22, 2020
1 parent ced3ff1 commit 7b3036f
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 27 deletions.
28 changes: 15 additions & 13 deletions lib/marked.esm.js
Expand Up @@ -2196,20 +2196,22 @@ function marked(src, opt, callback) {
marked.walkTokens(tokens, function(token) {
if (token.type === 'code') {
pending++;
highlight(token.text, token.lang, function(err, code) {
if (err) {
return done(err);
}
if (code != null && code !== token.text) {
token.text = code;
token.escaped = true;
}
setTimeout(() => {
highlight(token.text, token.lang, function(err, code) {
if (err) {
return done(err);
}
if (code != null && code !== token.text) {
token.text = code;
token.escaped = true;
}

pending--;
if (pending === 0) {
done();
}
});
pending--;
if (pending === 0) {
done();
}
});
}, 0);
}
});

Expand Down
28 changes: 15 additions & 13 deletions lib/marked.js
Expand Up @@ -2291,22 +2291,24 @@
marked.walkTokens(tokens, function (token) {
if (token.type === 'code') {
pending++;
highlight(token.text, token.lang, function (err, code) {
if (err) {
return done(err);
}
setTimeout(function () {
highlight(token.text, token.lang, function (err, code) {
if (err) {
return done(err);
}

if (code != null && code !== token.text) {
token.text = code;
token.escaped = true;
}
if (code != null && code !== token.text) {
token.text = code;
token.escaped = true;
}

pending--;
pending--;

if (pending === 0) {
done();
}
});
if (pending === 0) {
done();
}
});
}, 0);
}
});

Expand Down

1 comment on commit 7b3036f

@vercel
Copy link

@vercel vercel bot commented on 7b3036f May 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.