hilighter? #112

Closed
robogeek opened this Issue Jan 18, 2013 · 1 comment

Projects

None yet

2 participants

@robogeek

Your sample on the marked home page says to put this in the config

highlight: function(code, lang) {
    if (lang === 'js') {
      return highlighter.javascript(code);
    }
    return code;
  }

But I get this error

/Users/davidherron/node_modules/marked/lib/marked.js:1002
    throw e;
          ^
ReferenceError: highlighter is not defined
Please report this to https://github.com/chjj/marked.
    at Object.marked.setOptions.highlight (/Users/davidherron/Node.JS/akashacms/lib/renderer.js:39:14)
    at Parser.tok (/Users/davidherron/node_modules/marked/lib/marked.js:818:33)
    at Parser.parse (/Users/davidherron/node_modules/marked/lib/marked.js:759:17)
    at Function.Parser.parse (/Users/davidherron/node_modules/marked/lib/marked.js:746:17)
    at marked (/Users/davidherron/node_modules/marked/lib/marked.js:996:19)
    at renderSync (/Users/davidherron/Node.JS/akashacms/lib/renderer.js:162:41)
    at Object.module.exports.render (/Users/davidherron/Node.JS/akashacms/lib/renderer.js:231:24)
    at process2html (/Users/davidherron/Node.JS/akashacms/index.js:222:14)
    at process_and_render_files (/Users/davidherron/Node.JS/akashacms/index.js:289:25)
    at async.forEach (/Users/davidherron/Node.JS/node_modules/async/lib/async.js:86:13)
@chjj
Owner
chjj commented Jan 30, 2013

That's just an example configuration. It's not meant to be used. It's just a way of illustrating how a highlighter can be used with marked.

@chjj chjj closed this Jan 30, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment