Skip to content

hilighter? #112

Closed
Closed

Description

@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)

Activity

  1. chjj commented on Jan 30, 2013

    @chjj
    Member

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions