-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Highlighter function has no callback method #193
Comments
Are you using the async version of marked? Look at the example in usage where the second argument to the |
As @ChrisWren said, you should pass arguments with 3 arity in order to do asynchronous stuff. Take a look at an API here var marked = require('marked');
var str = require('fs').readFileSync('./foo.js').toString();
var options = {
gfm: true,
highlight: function (code, lang, callback) {
pygmentize({ lang: lang, format: 'html' }, code, function (err, result) {
if (err) return callback(err);
callback(null, result.toString());
});
}
};
var html;
// It'll throw error
// html = marked(str);
marked(str, options, function(err, result) {
html = result;
}); I'm writing this because I've just got the same error and looked around docs and issues. |
|
I'm using the example for pygmetize-bundled where you pass a callback through to
highlight
:But I get this error:
The text was updated successfully, but these errors were encountered: