Skip to content

Commit

Permalink
Switches to the official Highlight.js module
Browse files Browse the repository at this point in the history
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
searls committed Mar 16, 2013
1 parent eaefe05 commit 379c34f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions journo.litcoffee
Original file line number Diff line number Diff line change
Expand Up @@ -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
--------------
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {},
Expand Down

0 comments on commit 379c34f

Please sign in to comment.