Skip to content
Browse files

Switches to the official Highlight.js module

The highlight module being used previously is a 
little quirky out of the box (for me, it was only
loading PHP by default and actually didn't have 
CoffeeScript present at all). 

Additionally, even with the official module, my
CoffeeScript is usually detected as if it were 
Perl (I'm not sure what this says about me), so
I wanted to continue supporting named code blocks
(e.g. ``` coffeescript)
  • Loading branch information...
1 parent eaefe05 commit 379c34fce0dd7c407c02b29a6f20a408bfd22919 @searls searls committed Mar 16, 2013
Showing with 6 additions and 4 deletions.
  1. +5 −3 journo.litcoffee
  2. +1 −1 package.json
View
8 journo.litcoffee
@@ -194,12 +194,14 @@ We syntax-highlight blocks of code with the nifty **highlight** package that
includes heuristics for auto-language detection, so you don't have to specify
what you're coding in.
- {Highlight} = require 'highlight'
+ highlight = require 'highlight.js'
marked.setOptions
highlight: (code, lang) ->
- Highlight code
-
+ if highlight.LANGUAGES[lang]?
+ highlight.highlight(lang, code, true).value
+ else
+ highlight.highlightAuto(code).value
Publish a Feed
--------------
View
2 package.json
@@ -8,7 +8,7 @@
"underscore": ">= 1.4.3",
"marked": ">= 0.2.6",
"mime": ">= 1.2.7",
- "highlight": ">= 0.2.3",
+ "highlight.js": ">= 7.3.0",
"rss": ">= 0.0.4"
},
"devDependencies": {},

0 comments on commit 379c34f

Please sign in to comment.
Something went wrong with that request. Please try again.