Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Switch to highlight.js

Just a better maintained node fork of http://softwaremaniacs.org/soft/highlight/en/
  • Loading branch information...
commit 138e8026cd24d03708f7234ec11397b468edaf8d 1 parent 90c6dad
@jnordberg authored
Showing with 6 additions and 4 deletions.
  1. +1 −1  package.json
  2. +5 −3 src/plugins/markdown-page.coffee
View
2  package.json
@@ -28,7 +28,7 @@
"marked": "git://github.com/jnordberg/marked.git",
"coffee-script": ">=1.3.0",
"async": "0.1.x",
- "highlight": "0.2.x",
+ "highlight.js": "1.2.x",
"jade": ">=0.25.0",
"ncp": "0.2.x",
"rimraf": "2.x.x",
View
8 src/plugins/markdown-page.coffee
@@ -1,4 +1,4 @@
-{Highlight} = require 'highlight'
+hljs = require 'highlight.js'
marked = require 'marked'
async = require 'async'
path = require 'path'
@@ -59,8 +59,10 @@ parseMarkdownSync = (content, baseUrl) ->
for token in tokens
switch token.type
when 'code'
- # token.lang is set since this is github markdown, but highlight has no way to manually set lang
- token.text = Highlight token.text, ' ' # string is tab replacement
+ if token.lang?
+ token.text = hljs.highlight(token.lang, token.text).value
+ else
+ token.text = hljs.highlightAuto(token.text).value
token.escaped = true
return marked.parser tokens
Please sign in to comment.
Something went wrong with that request. Please try again.